[squeak-dev] The Trunk: Chronology-Core-ul.76.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Mar 31 08:30:05 UTC 2022


Levente Uzonyi uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-ul.76.mcz

==================== Summary ====================

Name: Chronology-Core-ul.76
Author: ul
Time: 31 March 2022, 10:29:59.505362 am
UUID: b883c0a9-ae6e-4c05-bea8-2ca5b9c3d464
Ancestors: Chronology-Core-ct.75

- avoid the creation of a Duration in Time class >> #localMicrosecondClock by using #localOffsetSeconds instead of #localOffset and #asSeconds.
- fixed the comment of Time class >> #updateTimeZoneCacheAt:

=============== Diff against Chronology-Core-ct.75 ===============

Item was changed:
  ----- Method: Time class>>localMicrosecondClock (in category 'clock') -----
  localMicrosecondClock
  	"Answer the local microseconds since the Smalltalk epoch (January 1st 1901, the start of the 20th century).
  	 The value is derived from the current UTC wallclock time and the image's current notion of time zone."
+ 	^self utcMicrosecondClock + (DateAndTime localOffsetSeconds * 1000000)!
- 	^self utcMicrosecondClock + (DateAndTime localOffset asSeconds * 1000000)!

Item was changed:
  ----- Method: Time class>>updateTimeZoneCacheAt: (in category 'clock') -----
  updateTimeZoneCacheAt: posixUtcMicrosecondClock
+ 	"Tell the VM to update its cached time zone value if the POSIX UTC time has reached the value stored in UpdateVMTimeZoneCacheAt. Assume that posixUtcMicrosecondClock is an integer with the current POSIX UTC microsecond clock value. Return true if the cache was updated to indicate that the time zone may have changed."
- 	"Tell the VM to update its cached time zone value if the POSIX UTC time reached the valute stored in UpdateVMTimeZoneCacheAt has been reached. Assume that posixUtcMicrosecondClock is an integer with the current POSIX UTC microsecond clock value. Return true when the cache was updated to indicate that the time zone may have changed."
  
  	| updateInterval |
  	UpdateVMTimeZoneCacheAt ifNil: [
  		"Automatic update is disabled."
  		^false ].
  	posixUtcMicrosecondClock < UpdateVMTimeZoneCacheAt ifTrue: [ ^false ].
  	self primitiveUpdateTimeZone ifNil: [ 
  		"The primitive failed."
  		^false ].
+ 	updateInterval := 1800000000. "This could be a preference but 30 minutes works for all upcoming DST change times."
- 	updateInterval := 1800000000. "This could be a preference but 30 minutes matches all upcoming DST change times."
  	UpdateVMTimeZoneCacheAt := posixUtcMicrosecondClock // updateInterval + 1 * updateInterval "Round up posixUtcMicrosecondClock to the next multiple of updateInterval.".
  	^true!



More information about the Squeak-dev mailing list