cancel
Showing results for 
Search instead for 
Did you mean: 

daylight saving time & NTP

 
SOLVED
Go to solution
MD Shafiullah
Occasional Advisor

daylight saving time & NTP

We're in Bangladesh where government is planning to introduce daylight saving time for the first time and may add one hour to the clock. My server is configured with NTP. Do u know what is the best way to reflect this time shift in the server?
6 REPLIES
kemo
Trusted Contributor

Re: daylight saving time & NTP

hi.

just reconfigure the NTP server if it is locally configured to synchronize from localhost clock.
this will reflect in all clients.


thanks
kamal

Re: daylight saving time & NTP

How many years in advance did they give notice?

NTP works on UTC so it doesn't care about DST.

Matti_Kurkela
Honored Contributor
Solution

Re: daylight saving time & NTP

According to the specifications, NTP always transmits UTC time only. This means daylight saving time is not an issue for NTP.

Each computer that uses NTP time synchronization *must* have correct timezone and DST settings locally, otherwise NTP won't work as designed.

In HP-UX, this means the TZ environment variable (from /etc/TIMEZONE) must be set to a value that has a DST specifier, and /usr/lib/tztab must have the correct DST definition for that timezone value. /usr/lib/tztab is a simple text file: you can read it to find out the choices.

If the correct definition does not exist yet in your /usr/lib/tztab, you can wait for HP to provide patches (for supported HP-UX versions) or edit the file yourself: the format description is available with the "man tztab" command.

It is also possible (although inconvenient) to include the entire timezone+DST specification in the TZ environment variable: please see the TZ variable description in "man environ".

Most Unix programs always convert all time values internally to Unix timestamps, which are based on UTC. The timestamp is then converted back to human-readable form on output. If a program works like this, the DST time shift is not an issue for it: the timestamps will always be consistent and non-ambiguous.

When it's time to add or remove one hour because of DST, it only affects the translation between the machine-readable timestamps and human-readable time values, nothing else. This allows the programs to run uninterrupted with no need for special handling for DST.

The Unix system clock runs internally in UTC time: it is *not* supposed to add or remove hours because of DST.

Trying to handle DST by manipulating the system clock instead of providing correct timezone+DST definitions is not recommended, as it requires all time-sensitive applications to be shut down for DST transitions.

MK
MK
MD Shafiullah
Occasional Advisor

Re: daylight saving time & NTP

Dear Matti,
Thanks for the ellaborate info. I have 20 server that takes time from the NTP server. I guess, i have to change time zone info in all 20 servers then. I though there was some mechanism in ntp server itself to reflect the time shifting in all client machines.

Anyway thanks again guys for your answere.
MD Shafiullah
Occasional Advisor

Re: daylight saving time & NTP

My ntp server gets time from a stratum 1 ntp time source. As ntp broadcast UTC time only, there is nothing to change in ntp server. I have to change timezone variable in all client server. Maybe sometime in near future HP will give a patch to include BST (Bangladesh Standard Time) and to reflect daylight saving mode.

Re: daylight saving time & NTP

>I have to change timezone variable in all client server.

You have to change tztab(4) and TZ if this is a new timezone.

>Maybe sometime in near future HP will give a patch to include BST (Bangladesh Standard Time) and to reflect daylight saving mode.

Has your company made a specific request to HP to add this enhancement?
Do you have an official URL where the date AND time of the transitions are listed?