Jan 31, '07 07:30:00AM • Contributed by: brainbox1100
foo$ zdump -v /etc/localtime | grep 2007
If you see this in the output, then your DST will not start (or end) on the correct day:
/etc/localtime Sun Apr 1 09:59:59 2007 UTC = Sun Apr 1 01:59:59 2007 PST isdst=0
/etc/localtime Sun Apr 1 10:00:00 2007 UTC = Sun Apr 1 03:00:00 2007 PDT isdst=1
/etc/localtime Sun Oct 28 08:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 PDT isdst=1
/etc/localtime Sun Oct 28 09:00:00 2007 UTC = Sun Oct 28 01:00:00 2007 PST isdst=0Notice that those dates do not correspond to the second Sunday in March nor the first Sunday in November. Read on for a solution to this problem...
[robg adds: For those who aren't aware, DST will start earlier this year in the United States and most of Canada. From the Daylight Savings Time entry at Wikipedia (note the start and end dates for 2007):
DST commonly begins in the northern hemisphere on the last Sunday in March or the first Sunday in April and ends on the last Sunday in October. However, due to the Energy Policy Act of 2005, beginning in 2007, the United States will begin observing DST from the second Sunday in March until the first Sunday in November.I looked at most of the US timezone files (Pacific, Central, etc.), and they all seem to be correct -- so many of you may not have to implement the solution explained in the remainder of this hint.]
The localtime file is actually just an alias to another file, as seen here (line break added for narrower display):
foo$ ls -lah /etc/localtime
lrwxr-xr-x 1 root wheel 37B Jan 8 06:19 /etc/localtime ->
/usr/share/zoneinfo/America/Vancouver
To fix the problem, you need to update the source file:
- Go to this nih.gov server and grab the file tzdata2007a.tar.gz. This filename may change over time, as new updates are added to the database. Just copy and paste the FTP URL into Safari to start.
- Extract the contents of the archive to a local folder (Stuffit Expander does a fine job if you don't know how); my folder is called tzdata2007a.
- In Terminal, cd into that folder and run the following commands. Note that the modifications I'm after are in the file named northamerica. However, some modifications where made to the europe and africa files as well, and the last command, zic backwards, will complain if you don't include them. Here are the commands to run:
foo$ cd /path/to/tzdata2007a foo$ sudo zic europe foo$ sudo zic africa foo$ sudo zic northamerica foo$ sudo zic backwards
foo$ zdump -v /etc/localtime | grep 2007
You should now see Mar 11 and Nov 4, instead of the original Apr 1 and Oct 28. Much better!
