Chronos is one of the many Smalltalk-related blogs syndicated on Planet Smalltalk

Discussion of the Essence# programming language, and related issues and technologies.

Blog Timezone: America/Los_Angeles [Winter: -0800 hhmm | Summer: -0700 hhmm] 
Your local time:  


Chronos Version B1.4 Published

While checking out the new version of VisualWorks (7.4, a.k.a. the Winter Edition,) I discovered a problem that has actually been in the code since it was originally written, but which remained hidden from my tests until now. It turns out it was waiting for 2006 to arrive before revealing itself.

The root cause of the problem is that the latest version of the Olson TimeZone Database (2005q, and perhaps earlier versions, I haven't checked because it doesn't really matter) includes the following rule for the 'Asia/Jerusalem' time zone:

"Rule Zion 2006 2010 - Mar Fri>=26 2:00 1:00 D".

Such a rule is probably an error, since it specifies that the DST transition occurs on Friday on or after 26 March--a date which may not exist, since there are of course only 31 days in March, not 32. This problem was not discovered previously, because the rules for the years prior to 2006 don't specify a week with days beyond the end of the month.

As originally written, the WeekOfMonthDayOfWeek class will fail (noisily) in some circumstances when such an invalid week-of-month is specified. Personally, I would prefer to leave it that way, except for the fact that the data containing this invalid week-of-month specification is the Olson Time Zone rules. So I have reluctantly changed WeekOfMonthDayOfWeek so that it can gracefully handle weekly periods that overflow the number of days in a month, even though that's contrary to my preferred philosophy. I can't force the Olson Time Zone Database to live by my rules, nor can I expect that its authors will never make errors of this sort.

I found no issues with VW 7.4, so both new and old versions of Chronos should be compatible with any version of VW, subject to the caveats mentioned in the porting document on the Chronos website.

No comments: