[BUG] DateAndTime subtraction
David T. Lewis
lewis at mail.msen.com
Sat Nov 6 15:21:13 UTC 2004
When the clock on the wall in Detroit says 9:00am, the clock on the wall
in London says 2:00pm. The Duration difference between the corresponding
DateAndTime values should be zero. In Squeak, the difference is a Duration
of ten hours.
This change set documents the bug with a unit test, but does not attempt
to fix it.
Dave
-------------- next part --------------
'From Squeak3.7gamma of ''17 July 2004'' [latest update: #5987] on 6 November 2004 at 10:04:05 am'!
"Change Set: DateAndTimeDifferenceBug-dtl
Date: 2 November 2004
Author: David T. Lewis
When the clock on the wall in Detroit says 9:00am, the clock on the wall
in London says 2:00pm. The Duration difference between the corresponding
DateAndTime values should be zero. In Squeak, the difference is a Duration
of ten hours.
This change set documents the bug with a unit test, but does not attempt to
fix it."!
!DateAndTimeTest methodsFor: 'Tests' stamp: 'dtl 11/2/2004 20:31'!
testTimeZoneEquivalence
"When the clock on the wall in Detroit says 9:00am, the clock on the wall
in London says 2:00pm. The Duration difference between the corresponding
DateAndTime values should be zero."
"(self new setTestSelector: #testTimeZoneEquivalence) debug"
| twoPmInLondon nineAmInDetroit durationDifference |
twoPmInLondon _ '2004-11-02T14:00:00+00:00' asDateAndTime.
nineAmInDetroit !
_ '2004-11-02T09:00:00+05:00' asDateAndTime.
durationDifference _ twoPmInLondon - nineAmInDetroit.
self assert: durationDifference asSeconds = 0
! !
More information about the Squeak-dev
mailing list
|