Solipsism Gradient

Rainer Brockerhoff’s blog

This may come as a surprise to US-based readers, but Mac OS X daylight saving time (DST) algorithms are broken. (Yes, I’ll be filing a bug as soon as I have all the information together.)

Basically, the BSD underpinnings of Mac OS X use the standard timezone files in /usr/share/zoneinfo. There’s a symbolic link at /etc/localtime which points to the correct TZ file; in my case, /usr/share/zoneinfo/Brazil/East. So far so good…

Last weekend all Macs in Brazil running Mac OS X suddenly shifted one hour ahead. Apparently no one had thought of telling Apple icon_wink.gif that the official start of DST in Brazil had been postponed from Oct. 13 to Nov. 3. No one’s sure exactly why; it probably had to do with the presidential elections, or the unseasonably hot weather, or the dropping exchange rate, or all of those…

Naturally, I thought this would be simple to fix; just fix the TZ source file, recompile it with zic, distribute a patch, and presto. Little did I know. First of all, getting hold of the original TZ source file wasn’t easy. The updated files are supposed to be available at, which seems to be permanently down. Googling for the files yielded only a few hits, most of which hadn’t been updated since 1999 or 2000.

The obvious place to find them should have been Apple’s Darwin site. However, there’s no easy index to find which files are in which source module, and I had neither time nor bandwidth to download the whole 600+MB thing. Looking in Libc and a dozen other likely places yielded nothing.

I finally chose one of the latest files I could find and updated it according to the government’s official site. There were many small errors, but finally it seemed to be working and I published a patch.

A few days later some readers sent me mail, complaining that the Finder’s timestamps were being set one hour ahead. Entourage was also setting appointments one hour ahead, and similar reports came in for some other Carbon applications.

I’m still investigating this, but apparently the Finder (and some other Carbon apps) still use the old-style APIs to convert UTC to local time. These APIs, instead of using the BSD tables, apparently still use some classic database. Needless to say, there seems to be no easy method for synching this database with the BSD information…

One further problem is that the classic database is using an outdated rule of thumb for Brazil: DST is supposed to start on the first Sunday in October. That has indeed been the case for a couple of years, but not lately… anyway, Brazil is one of those countries where the actual DST dates are set anew every year by government decree. So any such rule of thumb will be more times wrong than right.

Unfortunately, the standard BSD TZ files are in a binary format. This is clearly one place where Apple should break with the standard and go to XML files. Standard Unix tools shouldn’t read those files directly anyway, as there’s an API to get specific information from them.

Last night I did a check on many well-known timezone sites. Most of them still have the old, incorrect, Oct. 13 date stored and therefore incorrectly tell users that DST is active in Brazil. A few still use the “first Sunday in October” rule and therefore have been wrong since Oct. 6! Only one lone site had correct information. All sites, without fail, are applying DST to all 4 of Brazil’s timezones, which is also wrong; only the Brazil/East zone applies DST (some states are exceptions – rarely the same ones).

The same problem, of course, hit many Internet provider’s servers, as they mostly use Linux. The standard fix has usually been to manually set the server’s clock, instead of fixing the TZ data. Those few servers that synch to time servers have to switch timezones instead. These quick-and-dirty fixes further confuses matters, as some software which explicitly checks for DST will continue to show the wrong time.

Finally, there seems to be a large-scale misconception that there are no TZ tables inside each computer, and that DST changes are broadcast by time servers; some people wrote me complaining that they had checked out several time servers, and that even the Brazilian servers were wrong! Of course, that’s not the case; time servers broadcast UTC time and this is converted to local time inside each computer.

Update: It seems that two routines in the Date&Time utilities, which convert between Local time and UTC, use fixed tables built into the CarbonCore framework executable, instead of the TZ tables. icon_twisted.gif

I’ll be updating this post as I find out more clues… stay tuned!

Face reading

No comments

Everybody – and I mean everybody – should read The Naked Face.

There seems to be much more about this on the web…

Update: Neal Stephenson’s Jipi and the Paranoid Chip also features analysis of facial expressions (and many other things). Neal’s one of my favorite writers; here are some more links to excerpts of his works. Several other great writers are featured on that page, which BTW is by Eva van Emden.

Even more weblogs…

No comments

Mike Daisey, Dilettante.

Kevin Marks’ Epeus’ Epigone.

Steve White’s Plurp. Be sure to look at his Home Page, too.


Ted Shelton.

Freedom to Tinker.

John Gruber’s Daring Fireball.

For web designers…

No comments’s a great interview with Google’s product Manager Marissa Mayer.

Thanks to Cory Doctorow’s boingboing for the link.

More blogs to watch

No comments

Mitch Ratcliffe; both the Business, Technology & Investing and the Social and Political weblogs are very interesting.

Dan Gillmor’s eJournal.

I think it’s time for me to look into doing a standard-issue “blogrolling” column on the first page of this site… mostly for my own convenience in checking all these links out every day or so.

More weblogs…

No comments

Britt Blaser’s Escapable Logic. Again, thanks to Doc Searls for the link.

Gordon Meyer’s Usable Help. Thanks to Cory Doctorow for the link.

David Weinberger’s JOHO the Blog. I can’t resist quoting A Blogger Code of UnProfessional Ethics:

My readers:

    …know me. They will judge me according to context.
    …are smart. They will not be misled by some stray comment I may happen to make.
    …are kind. They make allowances and forgive me ahead of time.

In return:

    I will speak my mind about what I care about.
    I will not revise too much or too carefully: Blogging about opera is still jazz.
    I will not anticipate and reply to every objection: Punctilliousness in pursuit of the appearance of propriety kills voice.
    If I apologize, it will be because I have actually betrayed my readers’ trust, not because I may have, might have, or could be misread as having done so.
    I pledge to keep the reading of my weblog purely optional.

O horário de verão no Brasil foi alterado na última hora, como sempre acontece. Pegue o pacote de atualização aqui! Se você prefere fazer pelo Terminal, use esse arquivo fonte (instruções inclusas).

Confira com o site do Governo, por via das dúvidas…


No comments

Everybody even faintly interested in Copyright and intellectual property issues – which nowadays should include every Internet user – should watch Lawrence Lessig’s Blog. He’s arguing the Eldred v. Ashcroft case before the US Supreme Court.

Eldred v. Ashcroft is important even if you don’t live in the US, as most countries these days seem inclined to copycat the US stance on many issues without questioning that stance in depth. If this goes on, many everyday activities such as listening to music, writing e-mail, linking to someone’s website or watching TV may cause you to violate some law or other in some place or way you’d never think about.

As a software author I’m definitely in favor of some sort of Copyright and of a way to live for a reasonable time on the proceeds of my work. On the other hand, I think that the recent tendency to patent and protect anything and everything for an indefinite time is deplorable and should be nipped in the bud.

In this connection, I’d like to recommend Janis Ian’s website. Not only does she write great songs – she also writes great articles! Internet Debacle and its follow-up is a must for anyone who ever bought a music CD. Read the other articles too – there isn’t a dull one in the bunch.

And, of course, you must also read Courtney Love Does The Math

For the record, I Am Not A Lawyer But My Wife Is icon_smile.gif. I’m also doing some occasional court work as an expert in intellectual property cases. It’s surprisingly interesting work.

Photos licensed by Creative Commons license. Unless otherwise noted, content © 2002-2021 by Rainer Brockerhoff. Iravan child theme by Rainer Brockerhoff, based on Arjuna-X, a WordPress Theme by SRS Solutions. jQuery UI based on Aristo.