#$Id: timezone.txt,v 1.0 2007/01/24 14:58:40 ewhite Exp $ Timezone data and DST Daylight Saving Time changes for the U.S. in 2007 and 2008. All of the following notes use the Central time zone as the example. Documentation for making changes to the timezone files are difficult to find and scattered. Here is a quick and dirty cheat-sheet to update the tzdata files. 1. Verify that your tzdata files are incorrect. There are two ways to do this. zdump -v CST6CDT | grep 2007 Incorrect for 2007 will look like: CST6CDT Sun Apr 1 07:59:59 2007 UTC = Sun Apr 1 01:59:59 2007 CST isdst=0 gmtoff=-21600 CST6CDT Sun Apr 1 08:00:00 2007 UTC = Sun Apr 1 03:00:00 2007 CDT isdst=1 gmtoff=-18000 CST6CDT Sun Oct 28 06:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 CDT isdst=1 gmtoff=-18000 CST6CDT Sun Oct 28 07:00:00 2007 UTC = Sun Oct 28 01:00:00 2007 CST isdst=0 gmtoff=-21600 The second method (this does not work on Tru64): date --date="2007-03-11 08:00:10 UTC" Incorrect for 2007: Sun Mar 11 02:00:10 CST 2007 2. From ftp://elsie.nci.nih.gov/pub, download these two files: tzcode2007a.tar.gz tzdata2007a.tar.gz 3. In a scratch directory untar both of these files. 4. Run the following: zic -d ./tmp ./northamerica The result is a new directory with new tzdata binary files. 5. Verify the new tzdata files. This command will modify the TZ environment variable to point to your scratch directory and not the default zoneinfo directory. It also uses the UTC clock plus the 6 hour offset for CST. Keep in mind that the UTC clock does not change. TZ=`pwd`/CST6DST date --date="2007-03-10 08:00:10 UTC" The results should be Sat Mar 10 02:00:10. This is correct for that day. Now test for CDT. TZ=`pwd`/CST6DST date --date="2007-03-11 08:00:10 UTC" The results should be Sun Mar 11 03:00:10. With this result, a new and improved tzdata file is available for use. 6. Now comes the hard part. You must find where your system stores its default localtime file and where it keeps the zoneinfo files. Normally, /etc/localtime is used as the default system tzdata file. However, this file may be a copy or a link. Slackware 10.2 and 11.0: has both a copy and a link. The link is to /usr/share/zoneinfo/US/Central. This file, /etc/localtime and /usr/share/zoneinfo/CST6CDT are the same. Suse 9.2: /etc/localtime, /etc/share/zoneinfo/CST6CDT and /etc/share/zoneinfo/US/Central are copies of the same. Tru64: files are in /etc/zoneinfo and localtime is a link to /etc/zoneinfo/CST6DST. Tru64 does not have an /etc/localtime file. 7. Save and replace the tzdata file for your system. For example: mv /etc/localtime /etc/localtime.old mv /usr/share/zoneinfo/CST6CDT /usr/share/zoneinfo/CST6CDT.old mv /usr/share/zoneinfo/US/Central /usr/share/zoneinfo/US/Central.old From the tmp in your scratch directory: cp CST6CDT /etc/localtime cp CST6CDT /usr/share/zoneinfo/CST6CDT cp CST6CDT /usr/share/zoneinfo/US/Central As my machine does not move between timezones, I chose not to move all the tzdata files. One could rename the zoneinfo directory and replace it with the contents of the scratch tmp directory. 8. Final verification. zdump -v CST6CDT | grep 2007 CST6CDT Sun Mar 11 07:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 CST isdst=0 gmtoff=-21600 CST6CDT Sun Mar 11 08:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 CDT isdst=1 gmtoff=-18000 CST6CDT Sun Nov 4 06:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 CDT isdst=1 gmtoff=-18000 CST6CDT Sun Nov 4 07:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 CST isdst=0 gmtoff=-21600 date --date="2007-03-11 08:00:10 UTC" Sun Mar 11 03:00:10 CDT 2007 #$Source: /home/ewhite/notes/lnxsysnotes/RCS/timezone.txt,v $ #$Log: timezone.txt,v $ #Revision 1.0 2007/01/24 14:58:40 ewhite #Initial revision #