[squeak-dev] [ANN] TZ-Olson on SqueakMap
David T. Lewis
lewis at mail.msen.com
Tue Mar 12 12:16:46 UTC 2019
TZ-Olson is an Olson time zone database for Squeak. It is now listed
on SqueakMap at http://map.squeak.org and maintained at
http://www.squeaksource.com/TimeZoneDatabase.
See https://en.wikipedia.org/wiki/Tz_database for background and general
information. The class comment for TimeZoneDatabase provides additional
details.
The Squeak Chronology package, especially class DateAndTime, represents time
in terms of magnitude (seconds relative to a Posix or Smalltalk reference
point) and offset from UTC, where the offset allows the DateAndTime to be
displayed relative to a local timezone. When combined with Olson time zone
tables, any instance of DateAndTime may be displayed for another time zone,
and a local time specification in any time zone may be used to create a
DateAndTime instance with correct magnitude.
TZ-Olson is a subset of the original TimeZoneDatabase package for Squeak,
and replaces it for Squeak images beginning with Squeak 5.3.
Examples:
To show the current time in central Europe:
DateAndTime now inTimeZoneNamed: 'CET'
To create a DateAndTime for a local time in another time zone, accounting
for daylight savings time changes:
DateAndTime
year: 2013
month: 3
day: 31
hour: 13
minute: 17
second: 19
inTimeZoneNamed: 'CET'
To locate a suitable time zone:
TimeZoneDatabase grepFor: 'CET'.
TimeZoneDatabase grepFor: 'Detroit'.
To set the default time zone in the database to match that of your operating system:
TimeZoneDatabase defaultLocation: 'CET'.
To inspect daylight savings transition times:
TimeZoneDatabase defaultTimeZone dstTransitionTimes.
Dave
More information about the Squeak-dev
mailing list
|