--- a/AbstractTime.st Wed May 08 12:46:06 2019 +0200
+++ b/AbstractTime.st Wed May 08 12:54:16 2019 +0200
@@ -823,6 +823,11 @@
- aTimeOrTimeDurationOrNumberOfSeconds
"return the delta in seconds between 2 times or subtract a number of seconds."
+ "/ Q: for Time - x hours
+ "/ should we convert to timestamp i.e. caring for time-wrapping at midnight?
+ "/ no - for compatibility, we'll get the time-within-the day again
+ "/ if you need the real timestamp, a for it explicitly
+
^ aTimeOrTimeDurationOrNumberOfSeconds differenceFromTimestamp:self.
"
@@ -833,6 +838,8 @@
Time now - 3600. -> 03:38:23 PM
Time now - 3600 seconds. -> 03:38:35 PM
(Time now addSeconds:10) - Time now -> 10s
+ Time now - 1 hours. -> 11:04:02
+ Time now - 24 hours. -> 11:04:02
(TimeDuration fromString:'1.5hr') - 3600. -> 30m
(TimeDuration fromString:'1.5hr') - (TimeDuration fromString:'1hr') -> 30m
@@ -844,6 +851,8 @@
t2 := Timestamp now.
Transcript showCR:('seconds passed: ' , (t2 - t1) printString).
"
+
+ "Modified (comment): / 08-05-2019 / 12:49:59 / Claus Gittinger"
!
addDays:numberOfDays