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:  

2007-01-17

VW: 2007 TimeZone settings for North America

Those of you who reside in North America and use VisualWorks (or ship VW-hosted applications to North America,) but aren't using Chronos, need to update your time zone rules. The rules for the North American time zones currently in all shipped versions of VisualWorks are not correct for 2007 and later, since the US Congress changed start and end rules for daylight saving time in the United States, effective as of 2007.

The old rules (which had been in effect since 1987) were that the transition from standard time to daylight saving time happened on the first Sunday of April, and the transition from daylight saving time back to standard time happened on the last Sunday of October (both at 2am local time.) Under the new rules, standard time transitions to daylight saving time on the second Sunday of March, and transitions back to standard time on the first Sunday of November.

One way to make the necessary change is to evaluate the following "do it" (which is correct for Pacific Time):

TimeZone 
setDefaultTimeZone:
(TimeZone
timeDifference: -8 "Pacific Time"
DST: 1 at: 2
from: 73 "Second Sunday of March"
to: 311 "First Sunday of November"
startDay: #Sunday).

Instead of the "timeDifference: -8" which is correct for Pacific Time, Mountain Time has a time difference of -7 hours, Central Time has a time difference of -6 hours, and Eastern Time has a time difference of -5 hours. Arizona is the big exception, since it does not observe daylight saving time (but Navajo reservations in Arizona do observe DST!) The Arizona rules haven't changed.

Another way to get the correct rules is to install the TimeZone-External Repository-Olson TZDB package, which can be downloaded from the Chronos web site, or simply by clicking on the following link: TimeZone-External Repository-Olson TZDB (read and follow the installation instructions.)

Once the TimeZone-External Repository-Olson TZDB package has been installed (according to the instructions,) evaluating one of the following "do its" will update "Core.TimeZone default" with the correct rules:

(TimeZone at: 'America/New_York') beReference
(TimeZone at: 'America/Indiana/Indianapolis') beReference
(TimeZone at: 'America/Chicago') beReference
(TimeZone at: 'America/Denver') beReference
(TimeZone at: 'America/Boise') beReference
(TimeZone at: 'America/Phoenix') beReference
(TimeZone at: 'America/Los_Angeles') beReference
(TimeZone at: 'America/Nome') beReference
(TimeZone at: 'America/Adak') beReference
(TimeZone at: 'Pacific/Honolulu') beReference

Yet another way to get the correct time zone rules is to install Chronos.


1 comment:

Anonymous said...

This is a good site