class: AbstractTime
comment/format in: #-
changed: #differenceFromTimestamp: fixed wrong difference
--- a/AbstractTime.st Wed May 07 16:32:05 2014 +0200
+++ b/AbstractTime.st Wed May 07 16:33:06 2014 +0200
@@ -469,6 +469,7 @@
"
! !
+
!AbstractTime methodsFor:'abstract'!
hours
@@ -588,11 +589,6 @@
- aTimeOrNumberOfSeconds
"return the delta in seconds between 2 times or subtract a number of seconds."
-"/ aTimeOrNumberOfSeconds isNumber ifTrue:[
-"/ ^ self species basicNew
-"/ setMilliseconds:(self getMilliseconds - (aTimeOrNumberOfSeconds * 1000) asInteger)
-"/ ].
-"/ ^ self getSeconds - aTimeOrNumberOfSeconds getSeconds
^ aTimeOrNumberOfSeconds differenceFromTimestamp:self.
"
@@ -605,7 +601,7 @@
|t1 t2|
t1 := Timestamp now.
- (Delay forSeconds:5) wait.
+ Delay waitFor:10 seconds.
t2 := Timestamp now.
Transcript showCR:('seconds passed: ' , (t2 - t1) printString).
"
@@ -900,7 +896,8 @@
"/ the correct thing to do (and I will, in the future) is to
"/ return a TimeDuration:
"/
- ^ TimeDuration fromMilliseconds:(self getMilliseconds - (aTimestamp getMilliseconds))
+ ^ TimeDuration fromMilliseconds:(aTimestamp getMilliseconds -self getMilliseconds).
+
"/ which is the same as: deltaFrom:aTimestamp
"/
"/ however, there might be old code around, which is not be prepared for
@@ -910,6 +907,7 @@
"/ ^ aTimestamp getSeconds - self getSeconds
! !
+
!AbstractTime methodsFor:'printing & storing'!
addPrintBindingsTo:aDictionary
@@ -1228,10 +1226,10 @@
!AbstractTime class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.78 2014-04-16 22:34:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.79 2014-05-07 14:33:06 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.78 2014-04-16 22:34:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.79 2014-05-07 14:33:06 stefan Exp $'
! !