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

Eduardo
2 min readFeb 3, 2020

--

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 (BIAScolumn), and also the difference in minutes that should be applied if the timezone has daylight savings time (DBIAScolumn), 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 bellow:

SELECT TOP 1 [RULEID]
,[TZENUM]
,[YEAR]
,[BIAS]
,[DBIAS]
FROM [DAX12_DATABASENAME].[dbo].[TIMEZONESRULESDATA]
WHERE TZENUM = 28 --Timezone::GMTMINUS0300BRASILIA enum value
AND YEAR = 2020
Result of the select query above

How to fix

To prevent this behavior we only 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

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

Links

--

--