[NTLUG:Discuss] Daylight Savings Time

George Lass george.lass at excellsvcs.com
Wed Feb 7 12:11:46 CST 2007


I'm not sure if this has been covered previously but just in
case it hasn't, I have spent some time fixing up my RedHat 8.0
system so that it can use a revised /etc/localtime for the
upcoming change to CDT.  Here are some notes that you might
find helpful if you are thinking about attempting the same
thing:



Daylight Saving Time (DST) Calculator on the Web:

http://webexhibits.org/daylightsaving/b.html

Command to check DST start / stop times on your local machine:

zdump -v /etc/localtime | grep 2007

NOTE: you need to specify the full pathname /etc/localtime.
DO NOT try:

zdump -v localtime

or

zdump -v ./localtime

when in the /etc directory.  It will not work as expected.

Here is the result of zdump on my new /etc/localtime file:

/etc/localtime  Sun Mar 11 07:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 
CST isdst=0 gmtoff=-21600
/etc/localtime  Sun Mar 11 08:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 
CDT isdst=1 gmtoff=-18000
/etc/localtime  Sun Nov  4 06:59:59 2007 UTC = Sun Nov  4 01:59:59 2007 
CDT isdst=1 gmtoff=-18000
/etc/localtime  Sun Nov  4 07:00:00 2007 UTC = Sun Nov  4 01:00:00 2007 
CST isdst=0 gmtoff=-21600


The RedHat 8.0 source distribution for glibc contains the
source code file(s) needed to generate timezone files.
For the USA you can use the file:

usr/src/redhat/BUILD/glibc-2.2.93/timezone/northamerica

Here is what needs to be changed for the new start and
stop dates as noted by diff:

diff northamerica northamerica.new
97c97,98
< Rule  US      1967    max     -       Oct     lastSun 2:00    0       S
---
 > Rule  US      1967    2006    -       Oct     lastSun 2:00    0       S
 > Rule  US      2007    max     -       Nov     Sun>=1  2:00    0       S
102c103,104
< Rule  US      1987    max     -       Apr     Sun>=1  2:00    1:00    D
---
 > Rule  US      1987    2006    -       Apr     Sun>=1  2:00    1:00    D
 > Rule  US      2007    max     -       Mar     Sun>=8  2:00    1:00    D


Once changes have been made to the source file, it is compiled with zic.
Use the -d option so you don't over write your original files:

zic -d ~/zonedir northamerica

Finally copy the new file into /etc/localtime after checking it with zdump


Hope this helps, and BTW I have loaded the resulting /etc/localtime
file to an old RedHat system built in 2001 (no idea anymore what
release it is running) and it appears to check out OK using zdump.

Enjoy,

George

-- 
George E. Lass
Director of Information Technology
Excell Services
2323 Bryan St.
Suite 400
Dallas Tx 75201
V 214-270-1720 (new 5/18/2006)
C 214-682-8414





More information about the Discuss mailing list