[squeak-dev] DateAndTimeLeapTest>>testAsSeconds is broken
bert at freudenbergs.de
Thu Dec 1 15:17:47 UTC 2016
On Thu, Dec 1, 2016 at 2:29 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> On Thu, Dec 01, 2016 at 11:07:45AM +0100, Bert Freudenberg wrote:
Here I am raising a different (but admittedly related) question. How many
> elapsed between the Smalltalk epoch and the time 2004-02-29T13:33:00+02:00?
=> 3255507180 + DateAndTime localOffset asSeconds
('1901-01-01T00:00:00+02:00' asDateAndTime - DateAndTime epoch) asSeconds
= (0 + DateAndTime localOffset asSeconds - 7200)
('2004-02-29T13:33:00+02:00' asDateAndTime - DateAndTime epoch) asSeconds =
(3255514380 + DateAndTime localOffset asSeconds - 7200)
It can't be a constant but needs to take into account the local time zone.
Because Smalltalk epoch is defined as local time, the difference to a fixed
time necessarily involves the timezone offset.
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev