[squeak-dev] Time zone help

David T. Lewis lewis at mail.msen.com
Fri May 29 11:53:41 UTC 2009


On Thu, May 28, 2009 at 11:27:17PM -0400, C. David Shaffer wrote:
> I have an app that needs to track a local time and the different from 
> UTC.  If I do this:
> 
>    DateAndTime localTimeZone:
>       (TimeZone offset: -5 hours name: 'EST5EDT' abbreviation: 'EST5EDT').
> 
> Then it is easy for me to make conversions to UTC using #asUTC.  The 
> problem is this offset needs to be adjusted twice a year.  I've looked 
> at the time zone plugin but it seems pretty heavyweight for something 
> that is /almost/ workable in the image.  Does anyone have a solution for 
> this?
> 
> I'm using Squeak3.9.1 if it makes a difference.

Use TimeZoneDatabase. No plugin is required.
  http://wiki.squeak.org/squeak/1076

Latest source is always here:
  http://wiki.squeak.org/squeak/1076

Summary:
Complete implementation of Olson zoneinfo time zones for Smalltalk. The
time zone database may be loaded from compiled zoneinfo files, widely
available on unix and other operating systems. On Squeak, the time zones
are integrated with Chronology to permit zoneinfo time zones to be used
instead of the default TimeZone implementation.

Dave
 



More information about the Squeak-dev mailing list