| Greg ( @ 2007-02-08 15:31:00 |
| Current mood: | geeky |
Timezone update
Don't know if this was mentioned in the past about the changes to daylight savings time (DST) that takes effect this year, so I thought I'd be kind and share how to do this by hand. Just in case anyone here has a unsupported system, or their version of Linux has reached it's EOL.
Most of my personal boxes and a majority where I work have patches available, but a couple I use do not. My example was done on a SUN Ultra2 running Debian "Woody" 3.0 (running 3.0 being a relative term, as I've since upgraded the kernel and several other packages manually), but this should work on just about any Linux setup. I more or less followed this guide to do the updates.
The old timezone database had these as the old entries for when DST would kick-in. Note that April 1st is listed as the start and October 28th is the end. The new change to DST should read March 11th and November 4th respectively:
user@host:~> /usr/bin/zdump -v /usr/share/zoneinfo/US/Central |grep 2007 /usr/share/zoneinfo/US/Central Sun Apr 1 07:59:59 2007 UTC = Sun Apr 1 01:59:59 2007 CST isdst=0 gmtoff=-21600 /usr/share/zoneinfo/US/Central Sun Apr 1 08:00:00 2007 UTC = Sun Apr 1 03:00:00 2007 CDT isdst=1 gmtoff=-18000 /usr/share/zoneinfo/US/Central Sun Oct 28 06:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 CDT isdst=1 gmtoff=-18000 /usr/share/zoneinfo/US/Central Sun Oct 28 07:00:00 2007 UTC = Sun Oct 28 01:00:00 2007 CST isdst=0 gmtoff=-21600
- 1) Get the updated timezone data. This file is what I used.
- 2) Unpack the GZip TAR archive. You will get several timezone files. The only one I was interested in was for North America (
northamerica), so I more or less ignored the rest. Use whatever zone files apply to you. - 3) Compile the timezone source file(s) with
zicroot@host:~> /usr/bin/zic /path/to/zonefile - 4) No command-line arguments will put it in
/usr/share/zoneinfo/America, but you can specify a different location by the-dswitch. - 5) Change the
/etc/localtimealias. Now on my old config, the correct timezone database was located in/usr/share/zoneinfo/US/Central. The new one is located in/usr/share/zoneinfo/America/Chicago. Just select the nearest city in which you live with the correct timezone.1root@host:~> ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
Once this is done your timezone should reflect the correct dates and times:
user@host:~> /usr/bin/zdump -v /etc/localtime |grep 2007 /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
1: I also noticed that
/usr/share/zoneinfo/CST6CDT was new and appears to contain the same file information as /usr/share/zoneinfo/America/Chicago, so one could probably just use that file.