Posts Tagged DST

OS X: Fix Argentina DST October 2009

Date%20&%20TimeWell, at almost the last minute, DST was cancelled in Argentina this year. And this broke things, mostly computers. (Not for the first time either, the same thing happened two years ago here).

The debian folk came out with a fix at the last minute: so that fixed the linux machines, but OS X is a slower beast to move, so it’ll be a while before any change works its way through. In the meantime, Mac users in Argentina are left with broken clocks.

If you just want your clock to show the correct time for Argentina again, and don’t really care about the why, then just download and install the following:
Argentina_DST_Update_2.pkg – for 10.6.x only!
(Updated 2010-03-15)

I am no Mac expert, and this isn’t entirely tested, so be warned.

Anywho, this is how to update the tz data (aka zoneinfo), which should, in theory, fix the problem:

mkdir tzfix
cd tzfix/
curl ftp://elsie.nci.nih.gov/pub/tzdata2009n.tar.gz | tar -zxvf -
vi +219 southamerica

Change the two lines:

Rule Arg 2008 max - Mar Sun>=15 0:00 0 -
Rule Arg 2008 max - Oct Sun>=15 0:00 1:00 S

to the following

Rule Arg 2008 2009 - Mar Sun>=15 0:00 0 -
Rule Arg 2008 only
- Oct Sun>=15 0:00 1:00 S

(i.e. just two words to change). If it makes you feel better, here’s a diff.

Ok, save & close, and then compile it as follows:

sudo zic southamerica
sudo cp /usr/share/zoneinfo/America/Argentina/Buenos_Aires /usr/share/zoneinfo/America/Buenos_Aires

The sudo is necessary because you’re changing /usr/share/zoneinfo.
And that’s mostly it. Verify that it worked as follows:

zdump America/Argentina/Buenos_Aires
America/Argentina/Buenos_Aires Sun Oct 18 20:43:42 2009 ART

(note that the timezone is now ART, not ARST as previously).

So that fixes things for most of the command-line stuff. But you’ll notice that the clock on your desktop, iCal, and others, are still incorrect. We need to fix the ICU database also. Thankfully the latest sources are available for this from apple itself:

curl -O http://www.opensource.apple.com/tarballs/ICU/ICU-400.37.tar.gz
tar -zxf ICU-400.37.tar.gz
cd ICU-400.37/icuSources

ICU doesn’t come with the tzdata, but the readme in tzcode helpfully notes that if we place the tzdata*.tar.gz file in tools/tzcode/ it will be compiled automatically. You can pack up your own tzdata2009n.tar.gz that we used earlier if you wish, or use the one I prepared here:

cd tools/tzcode/
curl -o
tzdata2009o.tar.gz http://brickybox.com/wp-content/uploads/2009/10/tzdata2009otar.gz
cd ../../
./runConfigureICU MacOSX --with-data-packaging=archive
gnumake
sudo install -o root -g wheel -m 0644 -Sp data/out/icudt40l.dat /usr/share/icu/icudt40l.dat

And that’s it. We have a new ICU database. Reboot to see the changes.


Update (21st October): This technique works on the iPhone too. The iPhone already has zic (well, at least my one has), so you can simply copy your modified southamerica file onto the phone somewhere, and run (as root):

zic southamerica
cp /usr/share/zoneinfo/America/Argentina/Buenos_Aires /usr/share/zoneinfo/America/Buenos_Aires

And you can simply copy the data/out/icudt40l.dat you created for OS X into /usr/share/icu/icudt40l.dat on the iPhone. It causes Springboard to crash, but after a reboot everything works perfectly.


Update (10th November): I can’t believe it, today 10.6.2 update broke the damn icu stuff again.

mkdir 10_6_2_fix
cd 10_6_2_fix/
curl -O http://www.opensource.apple.com/tarballs/ICU/ICU-400.37.tar.gz
tar -zxf ICU-400.37.tar.gz
cd ICU-400.37/icuSources/tools/tzcode/
curl -O ftp://elsie.nci.nih.gov/pub/tzdata2009r.tar.gz
cd ../../
gnumake
sudo install -o root -g wheel -m 0644 -Sp data/out/icudt40l.dat /usr/share/icu/icudt40l.dat

Thanks to Jonathan Tapicer for pointing out that the tzdata file name has been updated (now at version R).


Update (5th February): I’ve had several requests to package this up in an installer, so here goes:
Argentina_DST_Update.pkg – for 10.6.x only!
(I don’t have a 10.5.8 any longer, so I can’t compile for it, sorry)


Update (15th March 2010): Yes, the ICU fix is broken again today. The problem seems to be more to do with automatic timezone detection (which OS X is now seeing as GMT -4) than anything to do with zoneinfo. For now, to fix it:

  • Download and install the new Argentina_DST_Update_2.pkg – for 10.6.x only!
  • Open a terminal and type:
    systemsetup -setusingnetworktime off
    systemsetup -settimezone America/Argentina/Buenos_Aires

This is fairly straightforward: it disables automatic timezone detection, and sets the timezone manually (you can use the -listtimezones switch to see a list of available timezones). If anyone knows how to update DateAndTime.prefPane (which appears to use GeoKit) please let me know.


Update (4th April 2010): I’m pleased to announce that 10.6.3 includes updated tzdata for Argentina (and elsewhere) that fixes all this silliness. Get it now (via software update) to make this problem go away.

, , ,

24 Comments

css.php