--- a/Time.st Thu May 10 23:55:05 2018 +0200
+++ b/Time.st Thu May 10 23:55:17 2018 +0200
@@ -732,96 +732,6 @@
!Time methodsFor:'comparing'!
-< aTime
- "return true if the receiver is before the argument"
-
- |milliseconds|
-
- aTime class == self class ifTrue:[
- ^ timeEncoding < aTime timeEncoding
- ].
- aTime isNumber ifTrue:[
- "backward compatibility for old code, which expects (time1 - time2) to return seconds"
- milliseconds := (aTime * 1000) asInteger. "integer seconds"
- ] ifFalse:[
- milliseconds := aTime getMilliseconds.
- ].
- ^ self getMilliseconds < milliseconds
-
- "
- (Timestamp now + 10) - Timestamp now < 10
- (Timestamp now + 10) - Timestamp now < 11
- "
-!
-
-<= aTime
- "return true if the receiver is before the argument"
-
- |milliseconds|
-
- aTime class == self class ifTrue:[
- ^ timeEncoding <= aTime timeEncoding
- ].
- aTime isNumber ifTrue:[
- "backward compatibility for old code, which expects (time1 - time2) to return seconds"
- milliseconds := (aTime * 1000) asInteger. "integer seconds"
- ] ifFalse:[
- milliseconds := aTime getMilliseconds.
- ].
- ^ self getMilliseconds <= milliseconds
-
- "
- (Timestamp now + 10) - Timestamp now <= 10
- (Timestamp now + 10) - Timestamp now <= 11
- (Timestamp now + 10) - Timestamp now <= 9
- "
-!
-
-= aTime
- "return true if the argument, aTime represents the same timeOfDay"
-
- |milliseconds|
-
- aTime class == self class ifTrue:[
- ^ timeEncoding = aTime timeEncoding
- ].
- aTime isNumber ifTrue:[
- "backward compatibility for old code, which expects (time1 - time2) to return seconds"
- milliseconds := (aTime * 1000) asInteger. "integer seconds"
- ] ifFalse:[
- aTime species == self species ifFalse:[^ false].
- milliseconds := aTime getMilliseconds.
- ].
- ^ self getMilliseconds = milliseconds
-
- "
- (Timestamp now + 10) - Timestamp now = 10
- (Timestamp now + 10) - Timestamp now = 9
- "
-!
-
-> aTime
- "return true if the receiver is before the argument"
-
- |milliseconds|
-
- aTime class == self class ifTrue:[
- ^ timeEncoding > aTime timeEncoding
- ].
- aTime isNumber ifTrue:[
- "backward compatibility for old code, which expects (time1 - time2) to return seconds"
- milliseconds := (aTime * 1000) asInteger. "integer seconds"
- ] ifFalse:[
- milliseconds := aTime getMilliseconds.
- ].
- ^ self getMilliseconds > milliseconds
-
- "
- (Timestamp now + 10) - Timestamp now > 10
- (Timestamp now + 10) - Timestamp now > 9
- "
-!
-
hash
"return an integer useful for hashing on times"
@@ -1195,6 +1105,13 @@
"
!
+setMilliseconds:millis additionalPicoseconds:ignoredPicos
+ "for protocol compatibility with timestamp.
+ However, the picos are ignored here"
+
+ ^ self setMilliseconds:millis
+!
+
setSeconds:secs
"set my time given seconds since midnight.
Notice the modulo operations here - there cannot be a time beyond 24hours