David T. Lewis uploaded a new version of Chronology-Core to project The Trunk: http://source.squeak.org/trunk/Chronology-Core-dtl.86.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.86 Author: dtl Time: 8 July 2023, 12:58:08.356304 pm UUID: 5988f4f7-a957-490c-aa53-1c59e28a3179 Ancestors: Chronology-Core-dtl.85
Rearrange DateAndTime class>>now to avoid a duplicate primitiveUtcWithOffset call when using a local time zone, e.g. Olson time zone from external package TZ-Olson. Remove package preamble and postscript.
=============== Diff against Chronology-Core-dtl.85 ===============
Item was removed: - (PackageInfo named: 'Chronology-Core') preamble: '"below, add code to be run before the loading of this package" - - "Remember all instances of TimeZone. These will become FixedTimeZone in the postscript" - TimeZone instSize = 3 ifTrue: [ - Smalltalk at: #TimeZoneInstances put: - (Dictionary newFrom: ( - TimeZone allInstances collect: [:tz | - tz -> { tz offset . tz name . tz abbreviation }]))]. - '!
Item was changed: ----- Method: DateAndTime class>>now (in category 'ansi protocol') ----- now "Answer time now as reported by #primitiveUtcWithOffset. If the automaticTimeZone preference is false, use the offset provided by LocalTimeZone rather than the offset provided by the primitive."
+ | dt | + dt := self basicNew initializeFromPrimitive. self automaticTimezone + ifFalse: [dt localOffsetSeconds: (self localTimeZone offsetAt: dt) asSeconds ]. + ^dt. - ifTrue: [ ^ self basicNew initializeFromPrimitive ] - ifFalse: [ | timeArray | - timeArray := Time posixMicrosecondClockWithOffset. - ^ self utcMicroseconds: timeArray first offset: self localOffsetSeconds ] !
Item was removed: - (PackageInfo named: 'Chronology-Core') postscript: '"Let all old instances of TimeZone become FixedTimeZone" - (Smalltalk globals removeKey: #TimeZoneInstances ifAbsent: []) - ifNotNil: [ :instanceData | - instanceData keysAndValuesDo: [ :instance :data | | newInstance | - newInstance := FixedTimeZone - offset: data first - name: data second - abbreviation: data third. - instance becomeForward: newInstance ]]. - '!
squeak-dev@lists.squeakfoundation.org