David T. Lewis uploaded a new version of Chronology-Core to project The Trunk: http://source.squeak.org/trunk/Chronology-Core-dtl.81.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.81 Author: dtl Time: 6 September 2022, 12:01:42.15096 pm UUID: ffc48d2d-0f38-4d45-b3b3-d973d8ed08c5 Ancestors: Chronology-Core-ct.80, Chronology-Core-dtl.80
Merge Chronology-Core-dtl.80 Reference https://github.com/squeak-smalltalk/squeak-object-memory/issues/23 DateAndTime>>offset: implementation is incorrect
=============== Diff against Chronology-Core-ct.80 ===============
Item was added: + ----- Method: DateAndTime>>asLocalAt: (in category 'squeak protocol') ----- + asLocalAt: anOffset + "Answer a DateAndTime for a different time zone offset that has the same + year, month, day, hour, minute, and second as this instance, and with + printString that matches except for time zone offset." + + | newOffset newMicros | + newOffset := anOffset asDuration asSeconds. + newMicros := localOffsetSeconds - newOffset * 1000000 + utcMicroseconds. + ^ self class utcMicroseconds: newMicros offset: newOffset + !
Item was changed: ----- Method: DateAndTime>>offset: (in category 'ansi protocol') ----- offset: anOffset + "Answer a <DateAndTime> equivalent to the receiver but with its local time + being offset from UTC by offset. - "Answer a DateAndTime for a different time zone offset that has the same - year, month, day, hour, minute, and second as this instance, and with - printString that matches except for time zone offset."
+ See asLocalAt: for the earlier behavior of this method." + + ^ self class + utcMicroseconds: utcMicroseconds + offset: anOffset asDuration asSeconds! - | newOffset newMicros | - newOffset := anOffset asDuration asSeconds. - newMicros := localOffsetSeconds - newOffset * 1000000 + utcMicroseconds. - ^ self class utcMicroseconds: newMicros offset: newOffset - !
Item was changed: ----- Method: DateAndTime>>utcOffset: (in category 'squeak protocol') ----- utcOffset: anOffset + "Compatiblity. Answer a DateAndTime equivalent to the receiver but offset from UTC by anOffset." + + ^ self offset: anOffset! - "Answer a DateAndTime equivalent to the receiver but offset from UTC by anOffset" - ^ self class - utcMicroseconds: utcMicroseconds - offset: anOffset asDuration asSeconds!
Item was changed: ----- Method: Timespan class>>current (in category 'squeak protocol') ----- current + ^ self starting: (DateAndTime now asLocalAt: self defaultOffset)! - ^ self starting: (DateAndTime now offset: self defaultOffset)!
squeak-dev@lists.squeakfoundation.org