up to date 

A UTC based implementation of DateAndTime


Project Description

As of January 2019 this project has been merged in Squeak trunk in package Chonology-Core.

The traditional implementation of DateAndTime uses instance variables 'seconds offset jdn nanos' and calculates its magnitude based on those varables in conjunction with the local TimeZone.

Replace this with an implementation using instance variables 'utcMicroseconds localOffsetSeconds'. This represents time magnitude as elapsed microseconds since the Posix epoch, with localOffsetSeconds representing local offset from UTC. The magnitude is used for comparison and duration calculations, and the local offset is used for displaying this magnitude in the context of a local time zone. The implementation ignores leap seconds, which are adjustments made to maintain earth rotational clock time in synchronization with elapsed seconds.

DateAndTime class>>now will use #primitiveUtcWithOffset to obtain current time in UTC microseconds with current local offset in seconds. The primitive provides an atomic query for UTC time and local offset as measured by the OS platform. If primitiveUtcWithOffset is not available, the traditional implementation is used, which relies on a primitive for microseconds in the local time zone and derives UTC based on the TimeZone setting.

Updates in package Chronology-Core are decendents of Squeak trunk Chronology-Core-cmm.2. These are suitable for Squeak trunk as of March 2016.

The changes should be loaded in sequence beginning with Chronology-Core-dtl.3. Begin by loading the first four files, then load the most recent version.

CAUTION: These changes are not easily reversed. Try them first in a throw away image.


Creator:Dave Lewis
Admin:Dave Lewis
Developer:Bert Freudenberg, Levente Uzonyi, Chris Muller, Tobias Pape


Code commited to this repository will be automatically under MIT license.


location: 'http://www.squeaksource.com/UTCDateAndTime'
user: ''
password: ''


  • Chronology-Core
  • DateAndTimePerformance
  • Tests-UTCDateAndTime





Registered:7 March 2016 5:10:43 am
Total Releases:0
Total Versions:40
Total Downloads:4326
XHTML | CSS | RSS20 July 2019