up to date 
HomeProjectsTagsMembersGroupsHelp

A UTC based implementation of DateAndTime

OverviewWikiNewsVersionsLatest

Project Description

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.

Members

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

License

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

Registration

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

Packages

  • Chronology-Core
  • DateAndTimePerformance

Links

http://www.squeaksource.com/UTCDateAndTime.html
http://www.squeaksource.com/UTCDateAndTime

Global:Read

Statistics

Registered:7 March 2016 5:10:43 am
Total Releases:0
Total Versions:31
Total Downloads:2612
XHTML | CSS | RSS17 November 2018