'From Squeak3.10.1-basic of 23 May 2008 [latest update: #7173] on 23 May 2008 at 6:46:11 pm'! "Change Set: 7174msSinceMidnight-M474-kph Date: 23 May 2008 Author: Keith Hodges This change correct a calculation related to the millisecond clock correctly taking into account the fact that it's maximum value is Integer>>maxVal // 2."! !DateAndTime class methodsFor: 'squeak protocol' stamp: 'kph 10/20/2007 13:56'! milliSecondsSinceMidnight | msm msClock | msClock := self millisecondClockValue. ( msClock < LastMilliSeconds) ifTrue:[ "rolled over" MilliSecondOffset := MilliSecondOffset + (SmallInteger maxVal // 2) + 1 ]. LastMilliSeconds := msClock. [ msm := msClock + MilliSecondOffset. (msm >= 86400000) ] whileTrue: [ "next day" LastTick := -1. DaysSinceEpoch := DaysSinceEpoch + 1. MilliSecondOffset := MilliSecondOffset - 86400000 ]. "day rolled over sanity check" ((LastTick = -1) and: [ (Duration days: SqueakEpoch hours: 0 minutes: 0 seconds: (self clock totalSeconds)) days ~= DaysSinceEpoch ]) ifTrue: [ self initializeOffsets. ^ self milliSecondsSinceMidnight ]. ^msm ! !