In version 3.7.2, the method invoked from DateTime>>newWithDate:time: was modified to preserve the milliseconds of the Time, rather than rounding to seconds.
In versions earlier than 3.7, you can create instance of Time with a non-Integer milliseconds field, such as a SmallDouble. After upgrade to 3.7.2, these instances remain instances of Time (not the new special SmallTime), and retain their non-Integer milliseconds.
The conversion to seconds in 3.7 and 3.7.1 turned this into an integer, and avoided issues. When the non-Integer millisecond field is used directly, DateTime class >> newGmtWithYear:dayOfYear:milliseconds:timeZone: reports a primitive error.
It is recommended to convert all references to Time instances to refer to the equivalent SmallTime. SmallTimes are specials and do not require repository space.
The following edit to the DateTime class method will avoid issues with old instances of Time
newWithDate: aDate time: aTime timeZone: aTimeZone "Creates and returns an instance of the receiver from the specified values, in the time zone specified." | aDateTime | aDateTime := (self newGmtWithYear: (aDate year) dayOfYear: (aDate dayOfYear) milliseconds: (aTime asMilliseconds asInteger) timeZone: aTimeZone) subtractSeconds: (aTimeZone secondsFromGmt). (aDateTime isDstIn: aTimeZone) ifTrue: [ ^ aDateTime subtractSeconds: (aTimeZone secondsForDst) ] ifFalse: [ ^ aDateTime ].
Last updated: 2/28/25