#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Wed, 08 May 2019 12:54:16 +0200
changeset 24117 c1a02a758d28
parent 24116 ef0506792fc5
child 24118 02d39aaca894
#DOCUMENTATION by cg class: AbstractTime comment/format in: #-
AbstractTime.st
--- 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