How to fix Dynamics AX 2012 when the time is 1 hour ahead when not using daylight savings time
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 different 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 different 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 = 41 --Timezone::GMTPLUS0330TEHRAN enum? value
AND YEAR = 2023
How to fix
To prevent this behavior we only need to run some SQL code to update the?DBIAS?column to zero in our related timezone:
UPDATE [DAX12_DATABASENAME].[dbo].[TIMEZONESRULESDATA]
SET DBIAS = 0
WHERE TZENUM = 41 --Timezone::GMTPLUS0330TEHRAN enum?Iran value
AND YEAR >= 2023
After we run the update above we need to restart the DAX12 AOS for the fix take effect.
Links