<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 1, 2016 at 4:51 AM, David T. Lewis <span dir="ltr"><<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">DateAndTimeLeapTest>><wbr>testAsSeconds is broken. The test passes incorrectly as a<br>
result of a false assertion:<br>
<br>
        self assert: aDateAndTime asSeconds = <a href="tel:3255514380" value="+13255514380">3255514380</a>.<br>
<br>
Where aDateAndTime is specified in #setUp<br>
<br>
        aDateAndTime := (DateAndTime year: 2004 month: 2 day: 29 hour: 13 minute: 33 second: 0 offset: 2 hours).<br>
<br>
This time is 2004-02-29T13:33:00+02:00, which in UTC is 2004-02-29T11:33:00+00:00.<br>
<br>
The #asSeconds tests should test for elapsed seconds from the Smalltalk epoch<br>
until 2004-02-29T11:33:00+00:00. The correct number of seconds for this duration<br>
is 3255507180, not 3255514380 as asserted in the unit test.<br>
<br>
By definition, #asSeconds is the seconds elapsed since the Smalltalk epoch<br>
(see its method comment). By common agreement, the Smalltalk epoch was defined<br>
relative to Greenwich Mean Time (UTC). If these two statements are both true,<br>
then the test is broken.<br>
<br>
If there is no disagreement, I will fix the test and allow it to show the failure.<br></blockquote><div><br></div><div>Not necessarily disagreeing, but previously Squeak epoch was defined as local time. This is why "DateAndTime epoch" answers a local time.</div><div><br></div><div>This is basically because we had no time zone support at all, and no way to convert to UTC.</div><div><br></div><div>I agree basing it on UTC makes more sense, but I'm not sure how much code would need to change, and if some stored datetimes would be affected.</div><div><br></div><div>- Bert - </div></div><br></div></div>