The new US Daylight Savings Time (DST): Compliance testing. (tummy.com, ltd. Journal Entry)
tummy.com: we do linux

Wednesday February 14, 2007 at 16:20
Subject: The new US Daylight Savings Time (DST): Compliance testing.
Keywords: Linux, Technical, Timezones
Posted by: Sean Reifschneider

In 2 months (March 11, 2007), the new US Daylight Savings Time goes into effect. Normally this would happen on April 1. Read on to find out how you can tell if your systems are going to be an hour off for almost a month or not.

First off, this only impacts people who are using US timezones (either directly, by setting the system time, or by having a user on the system manually set the "TZ" environment variable). Recently distributions or distributions with recently patches (particularly of the libc packages) should have no problem.

How do you tell for sure? Run the following command and if you get the output here you should be safe:

[2] guin:~# zdump -v /etc/localtime | grep 2007
/etc/localtime  Sun Mar 11 08:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 MST
isdst=0 gmtoff=-25200
/etc/localtime  Sun Mar 11 09:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 MDT
isdst=1 gmtoff=-21600
/etc/localtime  Sun Nov  4 07:59:59 2007 UTC = Sun Nov  4 01:59:59 2007 MDT
isdst=1 gmtoff=-21600
/etc/localtime  Sun Nov  4 08:00:00 2007 UTC = Sun Nov  4 01:00:00 2007 MST
isdst=0 gmtoff=-25200
[2] guin:~# 

However, if you get the following your time will be off on March 11:

root@woody:~$ zdump -v /etc/localtime | grep 2007
/etc/localtime  Sun Apr  1 07:59:59 2007 UTC = Sun Apr  1 01:59:59 2007 CST
isdst=0 gmtoff=-21600
/etc/localtime  Sun Apr  1 08:00:00 2007 UTC = Sun Apr  1 03:00:00 2007 CDT
isdst=1 gmtoff=-18000
/etc/localtime  Sun Oct 28 06:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 CDT
isdst=1 gmtoff=-18000
/etc/localtime  Sun Oct 28 07:00:00 2007 UTC = Sun Oct 28 01:00:00 2007 CST
isdst=0 gmtoff=-21600
root@woody:~$ 

I hear you asking: I run ntp, won't that keep my time correct? No. NTP syncs the kernel clock, which is in UTC with no daylight savings in effect. When you ask the system what the local time is, this gets converted from UTC to local time via the timezone information databases (which we dump above). The NTP daemon will sync your time, but the local representation of it will still be off.

This is how Unix prevents from getting into an infinite loop, setting the clock back to 1:00:00am after 01:59:59am. The UTC clock always increments, even when localtime jumps backwards an hour.

So, this is how you tell on your production servers whether there will be problems or not.
(Post Reply)

Comment
Steve Webb
Subject: Very cool!
Awesome! I was wondering how to check for this. Thanks!

BTW, my FC3, FC4, FC6 and RHAS3 machines are all fine with the time change if anyone is wondering. :)

- Steve

Comment
Tkil
Subject: None
You said "in two months (March 11th)". That's actually a bit less than one month from today (February 14th)...
Comment
Sean Reifschneider
Subject: I guess...
I guess Tkil hasn't heard of Second February. :-)

Sean

Comment
Steve Webb
Subject: Oops.
So, after checking my servers again, the timezone patch *wasn't* on my FC3/FC4 machines.

FYI. to update:

yum -y update tzdata
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/America/Denver /etc/localtime

to test (bad if any output):
zdump -v /etc/localtime | grep 2007 | grep Apr

- Steve