Thursday, April 3, 2014

NTP and Timezone Data -- Why do we need DST patches

This year , Turkey 's government delayed changing over Daylight Saving Time by one day.
Normally, the swtiching would be at March 30, 2014 03:00 AM, but this year it was at March 31, 2014 03:00 AM.. Ofcourse, this have brought some questions into our minds, as our application and database servers should be configured to delay this DST switching by one day, too.

During my researches , I have seen that there is a misconception between Timezones and NTP. Some customer have trusted their Ntp servers, as they will be get the correct time from the Ntp server pools, and they decided not to do anything..  On the other hand, Oracle, Microsoft and other big vendors released new patches especially for this DST rule change in Turkey.. This misconception created the idea that " we dont need to patch our environments because we already use NTP". Anyways, this is not correct. Eventhough we use Ntp server for time syncronization , we still need the DST patches..

To understand why we need those DST patches even if we use NTP, we need to understand what NTP does.
NTP operates in GMT or lets say UTC. UTC is not related with DST rules.
It is unversal, not local time. So if we need to calculate the local time from universal time , we need to add or subtract our local time zone.
It is the job of the local system to convert this UTC to Local Time. Operating systems do this conversion using their timezone files.
For Oracle Linux , you can display your current DST rules with zdump as follows;
zdump -v Europe/Istanbul | grep 2014

Europe/Istanbul Mon Mar 30 00:59:59 2014 UTC = Mon Mar 30 02:59:59 2014 EET isdst=0 gmtoff=7200
Europe/Istanbul Mon Mar 30 01:00:00 2014 UTC = Mon Mar 30 04:00:00 2014 EEST isdst=1 gmtoff=10800
Europe/Istanbul Sun Oct 26 00:59:59 2014 UTC = Sun Oct 26 03:59:59 2014 EEST isdst=1 gmtoff=10800
Europe/Istanbul Sun Oct 26 01:00:00 2014 UTC = Sun Oct 26 03:00:00 2014 EET isdst=0 gmtoff=7200
As you see above, first two lines indicate that this Linux OS will switch the time at Mar 30 , which is not appropriate for 2014, as this year Turkey decided to changing over DST time at Mar 31..
So if we will leave this system as is, we will end up with a DST time switch at Mar 30 ..
That 's why we need those OS patches..

No comments :

Post a Comment