'From Squeak5.2 of 13 December 2018 [latest update: #18221] on 26 November 2018 at 8:17:56 am'! "Change Set: Fuel update for UTCDateAndTime Date: 26 November 2018 Author: David T. Lewis Update Fuel serialization for a DateAndTime in the new UTC format for Squeak, where DateAndTime has only the two instance variables 'utcMicroseconds' and 'localOffsetSeconds'. Compatibility is maintained with the traditional DateAndTime with 'seconds' 'offset' 'jdn' and 'nanos' instance variables. A DateAndTime serialized from one format can be materialized in an image using the other format, which may be important if serialzied data is kept in external files or databases."! !DateAndTime methodsFor: '*FuelPlatformExtensions' stamp: 'dtl 11/26/2018 08:17'! serializeOn: t1 self class instSize = 2 ifFalse: [ "traditional jdn, seconds, nanos, offset instance variables based on local time" t1 encodeUint32: self julianDayNumberUTC; encodeUint32: self nanoSecond; encodeInt24: self secondsSinceMidnight; encodeInt24: self offset asSeconds; encodeInt32: self offset nanoSeconds ] ifTrue: [ | ticks | "materialize to new format with UTC microseconds and local offset" ticks := self ticks. t1 encodeUint32: (ticks at: 1); encodeUint32: (ticks at: 3); encodeInt24: (ticks at: 2); encodeInt24: self offset asSeconds; encodeInt32: self offset nanoSeconds ] ! ! !DateAndTime class methodsFor: '*Fuel-Core' stamp: 'dtl 11/26/2018 00:49'! materializeFrom: aDecoder | jdn nanos seconds offset | jdn := aDecoder nextEncodedUint32. nanos := aDecoder nextEncodedUint32. seconds := aDecoder nextEncodedInt24. offset := Duration seconds: aDecoder nextEncodedInt24 nanoSeconds: aDecoder nextEncodedInt32. self instSize = 2 ifFalse: [ "traditional jdn, seconds, nanos, offset instance variables based on local time" ] ifTrue: [ "materialize to new format with UTC microseconds and local offset" seconds := seconds + offset asSeconds]. ^ self basicNew setJdn: jdn seconds: seconds nano: nanos offset: offset; yourself ! ! DateAndTime removeSelector: #fuelSet:nanoSecond:seconds:offset:!