#DOCUMENTATION by cg
authorClaus Gittinger <cg@exept.de>
Thu, 21 Sep 2017 18:54:10 +0200
changeset 22284 e6aaf78f69d6
parent 22283 3edefecbb6b6
child 22285 196d6c806fae
#DOCUMENTATION by cg class: TimeDuration added: #getExactSeconds comment/format in: #hours #milliseconds #minutes #seconds changed: #quotientFromPhysicalValue: (send #getSeconds instead of #seconds)
TimeDuration.st
--- a/TimeDuration.st	Thu Sep 21 18:51:50 2017 +0200
+++ b/TimeDuration.st	Thu Sep 21 18:54:10 2017 +0200
@@ -486,10 +486,20 @@
     "
 !
 
+getExactSeconds
+    "return the exact number of seconds.
+     In contrast to getSeconds, which returns them truncated."
+
+    ^ timeEncoding / 1000
+
+    "Created: / 21-09-2017 / 18:52:26 / cg"
+!
+
 hours
     "get the number of hours.
      (notice: that is NOT the total number of hours,
-     but the fractional part only. Use this only for printing"
+     but the fractional part only. 
+     Use this only for printing"
 
     ^ self 
         possiblyNegatedValueFromTimeEncodingInto:[:t |
@@ -499,12 +509,15 @@
      (Duration days: 9 hours: 1 minutes: 2 seconds: 3) hours
      (Duration days: -9 hours: -1 minutes: -2 seconds: -3) hours
     "
+
+    "Modified (comment): / 21-09-2017 / 18:53:32 / cg"
 !
 
 milliseconds
     "get the milliseconds part 
      (notice: that is NOT the total number of millis,
-     but the fractional part only. Use this only for printing.
+     but the fractional part only. 
+     Use this only for printing.
      asMilliseconds or getMilliseconds is probably what you want"
 
     ^ self 
@@ -517,12 +530,14 @@
     "
 
     "Modified: / 05-05-2010 / 14:22:04 / cg"
+    "Modified (comment): / 21-09-2017 / 18:53:26 / cg"
 !
 
 minutes
     "get the number of minutes.
      (notice: that is NOT the total number of minutes,
-     but the fractional part only. Use this only for printing"
+     but the fractional part only. 
+     Use this only for printing"
 
     ^ self 
         possiblyNegatedValueFromTimeEncodingInto:[:t |
@@ -533,12 +548,15 @@
      (Duration days: 9 hours: 1 minutes: 2 seconds: 3) minutes
      (Duration days: -9 hours: -1 minutes: -2 seconds: -3) minutes
     "
+
+    "Modified (comment): / 21-09-2017 / 18:53:22 / cg"
 !
 
 seconds
     "get the number of seconds.
      (notice: that is NOT the total number of seconds,
-     but the fractional part only. Use this only for printing.
+     but the fractional part only. 
+     Use this only for printing.
      asSeconds or getSeconds is probably what you want"
 
     ^ self 
@@ -550,6 +568,8 @@
      (Duration days: 9 hours: 1 minutes: 2 seconds: 3) seconds
      (Duration days: -9 hours: -1 minutes: -2 seconds: -3) seconds
     "
+
+    "Modified (comment): / 21-09-2017 / 18:53:13 / cg"
 ! !
 
 !TimeDuration methodsFor:'arithmetic'!