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:  

2006-01-12

External Repository for VW Core.TimeZones--all 500+ Olson Time Zones

I have implemented a package that adds support to VisualWorks' Core.TimeZone class for retrieving TimeZone instances from (and storing them into) an external repository. I have also added code to Chronos that generates an external repository of serialized Core.TimeZone instances.

The name of the package is TimeZone-External Repository-Olson TZDB. It's available from the Chronos web site (direct download link: http://www.chronos-st.org/downloads/VisualWorks/TimeZone-ExternalRepository-OlsonTZDB.zip. -- URL changed as of 2006-02-20)

The download file includes the installation instructions and the current version of the VisualWorks TimeZone Repository. The repository contains serialized instances of Core.TimeZone for all 500+ time zones in the Olson Time Zone Database.

Other than the use of Chronos to generate the external repository of Core.TimeZones, there is no other dependency or connection between Chronos and the TimeZone-External Repository-Olson TZDB package.

With the TimeZone-External Repository-Olson TZDB package installed (and whether or not Chronos is also installed,) one may retrieve instances of Core.TimeZone (with correct rules for the current year) as in the examples below. All the examples retrieve a Core.TimeZone instance from the external repository using one of the Olson keys, and then make that instance be the 'reference' (default) TimeZone for VisualWorks:


(TimeZone at: 'Australia/Sydney') beReference.
(TimeZone at: 'Asia/Tokyo') beReference.
(TimeZone at: 'Australia/Perth') beReference.
(TimeZone at: 'Asia/Calcutta') beReference.
(TimeZone at: 'Europe/Athens') beReference.
(TimeZone at: 'Europe/Berlin') beReference.
(TimeZone at: 'Europe/London') beReference.
(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: 'Pacific/Honolulu') beReference.



No comments: