The Trunk: 51Deprecated-mt.53.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: 51Deprecated-mt.53.mcz

commits-2
Marcel Taeumel uploaded a new version of 51Deprecated to project The Trunk:
http://source.squeak.org/trunk/51Deprecated-mt.53.mcz

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

Name: 51Deprecated-mt.53
Author: mt
Time: 4 August 2019, 9:37:27.289314 am
UUID: 9267700e-7002-bb4d-be66-86284fa6449f
Ancestors: 51Deprecated-dtl.52

Updates DateAndTime protocol for backwards compatibility to match the recent refactorings in Chronology.

=============== Diff against 51Deprecated-dtl.52 ===============

Item was changed:
  ----- Method: DateAndTime class>>nowWithOffset: (in category '*51deprecated') -----
  nowWithOffset: aDuration
+ "Answer time now as reported by #primitiveUtcWithOffset. If the primitive is not
+ available, answer the Posix epoch with time zone offset aDuration."
 
+ | timeArray |
+ self deprecated: 'This is just for backwards compatibility. Use DateAndTime class >> #now, which already contains correct offset information.'.
+ timeArray := Time posixMicrosecondClockWithOffset.
+ ^ self utcMicroseconds: timeArray first offset: aDuration asSeconds
+ !
- | clockValue nanos |
- self deprecated: 'use (... now offset: ...) instead'.
- clockValue := Time utcMicrosecondClock.
- "Ensure that consecutive sends of this method return increasing values, by adding small values to the nanosecond part of the created object. The next few lines are assumed to be executed atomically - having no suspension points."
- ((LastClockValue ifNil: [ 0 ]) digitCompare: clockValue) = 0
- ifTrue: [ NanoOffset := NanoOffset + 1 ]
- ifFalse: [ NanoOffset := 0 ].
- LastClockValue := clockValue.
- nanos := clockValue \\ 1000000 * 1000 + NanoOffset.
- clockValue := clockValue // 1000000.
- ^self basicNew
- setJdn: clockValue // SecondsInDay + SqueakEpoch
- seconds: clockValue \\ SecondsInDay
- nano: nanos
- offset: aDuration!