DEV Community

Cover image for How to fix Dynamics AX 2012 R3 when the time is 1 hour ahead when not using daylight savings time
Eduardo Silva Rossi
Eduardo Silva Rossi

Posted on

How to fix Dynamics AX 2012 R3 when the time is 1 hour ahead when not using daylight savings time

In 2020 I wrote this article in another platform telling how to fix a time zone problem in Dynamics AX 2012 R3 when a country changes its daylight savings time legislation. Recently, I noticed that some people experiencing the same problem in other countries so I decided to share this fix again here in DEV community.

The problem

On the second half of 2019 the brazilian government changed his timezone rules for the first time in several years. From that year on, daylight savings time would no longer be implemented in the national territory.

Given this situation, in a customer with Dynamics AX 2012 R3 we had some problems like transaction time one hour ahead in forms and reports and the inability to cancel an invoice within 1 hour of its posting.

Some context

In Dynamics AX 2012, time zones are defined in the system table TimeZoneRulesData (AOT/System Documentation/Tables/ TimeZoneRulesData). This table contains data like the difference in minutes between a local time zone and the time zone (GMT) UTC+0 (BIAS column), and also the difference in minutes that should be applied if the timezone has daylight savings time (DBIAS column), when this difference should be applied and others.

Note that the DBIAS column keeps the difference in minutes that should be applied in daylight savings time, so in time zones where the time is regressed by 1 hour this column will have the value of -60 as we can see in the result of the SQL statement bellow:

SELECT TOP 1 [RULEID]
      ,[TZENUM]
      ,[YEAR]
      ,[BIAS]
      ,[DBIAS]
  FROM [DAX12_DATABASENAME].[dbo].[TIMEZONESRULESDATA]
 WHERE TZENUM = 28 --Timezone::GMTMINUS0300BRASILIA enum value
   AND YEAR = 2020
Enter fullscreen mode Exit fullscreen mode

Result of the SQL statement above

How to fix

To prevent this behavior we need to run a simple SQL code to update the DBIAS column to zero in our related timezone:

UPDATE [DAX12_DATABASENAME].[dbo].[TIMEZONESRULESDATA]
   SET DBIAS = 0
 WHERE TZENUM = 28 --Timezone::GMTMINUS0300BRASILIA enum value
   AND YEAR >= 2020
Enter fullscreen mode Exit fullscreen mode

After we run the update above we need to restart the DAX12 AOS service for the fix take effect.

Links

Here you can find the complete Timezone enumeration and its values.
Dynamics AX 2012 Time Zone docs

Top comments (0)