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.pkg – for 10.6.x only!

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)

Popularity: 16% [?]

, , ,

  1. #1 by Frederic - October 24th, 2009 at 11:26

    Thanks for this!

    I am running windows and was wondering how to get the data/out/icudt40l.dat file to copy on my iphone.

    Can you help me ?

    Thanks

    Frederic

  2. #2 by Bricky - October 27th, 2009 at 13:27

    @Frederic
    The only way that I know is via ssh (on a jailbroken iphone). You can then
    scp data/out/icudt40l.dat root@your-iphone-ip-address:/usr/share/icu/icudt40l.dat
    to copy the file across.

    I guess you could probably do something using the iphone sdk tools too. Wouldn’t know where to start there though.

  3. #3 by Adrian M. - October 29th, 2009 at 19:34

    On 10.6 you could select Mendoza time which maps to ART (instead of ARST for Buenos Aires).

  4. #4 by Lionel - November 5th, 2009 at 00:01

    @ Bricky
    Could you share the icudt40l.dat for my iphone? I need to fix my Argentina time but I don’t have MacOS.

    Regards,

  5. #5 by Bricky - November 5th, 2009 at 15:15

    @Lionel

    icudt40l.dat

    This is the one I compiled on my mac (and subsequently put on the iPhone).

    hth

  6. #6 by Diego - November 5th, 2009 at 20:33

    Bricky:
    I’ve run all the commands and nothing happens.
    This is what i see in Terminal:

    Snow:~ diego$ zdump America/Argentina/Buenos_AiresAmerica/Argentina/Buenos_Aires Thu Nov 5 19:16:49 2009 ART
    Snow:~ diego$

    But whe i try to change the Time zone in the System Preferences:

    Argentina Summer Time (GMT-02:00)

    and all my calendar applications show the hour wrong.
    If I choose Mendoza (in 10.6.1 is GMT-03:00), like Adrian said, when I recieve an invitation from Buenos Aires TZ, it creates with 1 hour difference.

    what can I do???
    BTW: I’ve copied the icudt40l.dat that you left for Lionel, but when reboot the finder relaunches constantly, so i reinstall the one that I’ve created.

  7. #7 by Bricky - November 6th, 2009 at 10:56

    Hi Diego,

    There are a few things you can check.
    First, make certain that the icudt40l.dat file is not corrupted in any way:
    $ md5 icudt40l.dat
    MD5 (icudt40l.dat) = 252258445190565a121f7ebf356279b4

    If the md5 isn’t exactly the same, try downloading the file again.
    Next thing to check is the permissions. These should be:
    $ ls -alF /usr/share/icu/icudt40l.dat
    -rw-r--r-- 1 root wheel 13993024 21 Oct 17:49 /usr/share/icu/icudt40l.dat

    If these aren’t correct, you can fix them with chmod 0644, and chown root:wheel.

    hth.

  8. #8 by Jonathan Tapicer - November 8th, 2009 at 16:54

    Hi, it works, thanks. ftp://elsie.nci.nih.gov/pub/tzdata2009n.tar.gz doesn’t exist anymore, you should change it to the new version of tzdata (2009q): ftp://elsie.nci.nih.gov/pub/tzdata2009q.tar.gz

  9. #9 by Lionel - November 10th, 2009 at 09:17

    @ Bricky

    Thank you very much for the file! Works perfect!!!!

    Best Regards,

    Lionel

  10. #10 by Pablo - January 25th, 2010 at 02:24

    Hi, reading this post I cloud change time correctly.

    $ zdump America/Argentina/Buenos_Aires
    America/Argentina/Buenos_Aires Mon Jan 25 02:07:44 2010 ART

    (no ARST time)

    But, when I enter the next commands, this is what I get:

    $ ./runConfigureICU MacOSX –with-data-packaging=archive
    Running ./configure –with-data-packaging=archive for MacOS X (Darwin) using the GNU C++ compiler

    checking for ICU version numbers… release 4.0, library 40.0
    checking build system type… i386-apple-darwin9.8.0
    checking host system type… i386-apple-darwin9.8.0
    checking for gcc… no
    checking for cc… no
    checking for cc… no
    checking for cl… no
    configure: error: no acceptable C compiler found in $PATH
    See `config.log’ for more details.

    If the result of the above commands looks okay to you, go to the directory
    source in the ICU distribution to build ICU. Please remember that ICU needs
    GNU make to build properly…

    I’m new to MacOS, so please tell me what I have to do.

    Thank you.

    Pablo

    @Lionel

  11. #11 by Bricky - January 25th, 2010 at 03:00

    @Pablo
    Hi Pablo,

    You’ll need to download and install Xcode to compile ICU.

    hth.

  12. #12 by Pablo - January 25th, 2010 at 09:41

    @ Bricky
    Hi Bricky, thanks for your help.

    The strange thing is that I have wrong time only on the Menu Bar. Correct time is showed on my widgets and, on the zdump.

    Do you think I have to compile ICU? Is this the only way? I’m asking because I never compile a thing.

    Right now I’m downloading the Xcode (w/ iPhone sdk). I think this is what I need for my MacOS10.5.8.
    Can you send me the rights commands?

    Thanks again,

    Pablo

  13. #13 by Pablo - January 25th, 2010 at 13:12

    @ Bricky

    I installed Xcode and run these commands:
    ./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

    Then I restarted my Mac and still have the wrong time.

    I don’t know what is happening, can you help me, please?

    Thanks.

  14. #14 by Bricky - January 27th, 2010 at 18:03

    @Pablo
    The instructions above are for 10.6 Pablo, I’m not sure if they’ll work the same for 10.5.8.

    I’d suggest you first check if the new ICU was installed correctly, run the following
    ls -l /usr/share/icu/icudt40l.dat
    if it says “No such file or directory”, or if the date on the file is wrong (not the date you compiled it), then that’s the problem.

    Maybe try downloading the ICU tarball for 10.5.8 instead

    curl -O http://www.opensource.apple.com/tarballs/ICU/ICU-8.11.4.tar.gz
    And proceed with the remainder of the instructions as above. I don’t know if it’ll work, but you may have better luck.

  15. #15 by Pablo - January 30th, 2010 at 16:50

    @ Bricky

    Thank you very much! It worked perfect!
    I was looking for a solution since three weeks.

    Thanks again…

  16. #16 by Gon - February 4th, 2010 at 22:57

    @ Bricky
    Sorry for bothering but I’m having this huge problem and I don’t know how to fix it. I read your instructions but I’m not familiarized with these sort of codes. All the instructions I need to type them in “Terminal” at a time? I’ll be very thankfull if you can help me with this and sorry for my ignorance.

    Thanks in advance!

  17. #17 by Bricky - February 5th, 2010 at 06:56

    @Gon

    I’ve packaged this up as an installer Gon, try that.
    Argentina_DST_Update.pkg

  18. #18 by Gon - February 6th, 2010 at 13:12

    @ Bricky
    I really don’t know how to thank you. It works perfect and it was very extremely simple. THANK YOU VERY MUCH!!!

(will not be published)
Submit Comment
Subscribe to comments feed
  1. No trackbacks yet.
SetPageWidth