more format strings for milliseconds.
authorClaus Gittinger <cg@exept.de>
Wed, 13 Oct 1999 00:42:34 +0200
changeset 4904 33d322c419ba
parent 4903 1487c740eaba
child 4905 a18c448021d2
more format strings for milliseconds.
AbstractTime.st
--- a/AbstractTime.st	Tue Oct 12 23:04:33 1999 +0200
+++ b/AbstractTime.st	Wed Oct 13 00:42:34 1999 +0200
@@ -438,6 +438,8 @@
     aDictionary at:$s put:(s leftPaddedTo:2 with:$0).
     aDictionary at:$I put:(s := millis printString).
     aDictionary at:$i put:(s leftPaddedTo:3 with:$0).
+    aDictionary at:#milli1 put:((millis // 100) printString).
+    aDictionary at:#milli2 put:((millis // 10) printStringLeftPaddedTo:2 with:$0).
     aDictionary at:$t put:(seconds * minutes) printString.
     aDictionary at:$T put:(seconds * minutes * hours) printString.
     aDictionary at:$a put:ampm.
@@ -516,6 +518,9 @@
         %t      seconds within hour  (unpadded)
         %T      seconds from midNight  (unpadded)
 
+        %milli1 milliseconds, truncated to 1/10th of a second 0..9         
+        %milli2 milliseconds, truncated to 1/100th of a second 00..99 0-padded to length 2        
+
      AbsoluteTime only:
         %Day    day - unpadded                    
         %Mon    month - unpadded                    
@@ -535,7 +540,9 @@
      Time now printStringFormat:'%h:%m:%s'      
      Time now printStringFormat:'%H:%m:%s'      
      Time now printStringFormat:'%H:%m:%s.%i'           
-     AbsoluteTime now printStringFormat:'%H:%m:%s.%i'     
+     AbsoluteTime now printStringFormat:'%H:%m:%s.%i'   '0:41:49.721'  
+     AbsoluteTime now printStringFormat:'%H:%m:%s.%(milli1)'   
+     AbsoluteTime now printStringFormat:'%H:%m:%s.%(milli2)'     
      Time now printStringFormat:'%u:%m:%s %a'   
      Time now printStringFormat:'%h:%m'         
      Time now printStringFormat:'%h:%m'         
@@ -597,5 +604,5 @@
 !AbstractTime class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.21 1999-10-04 15:37:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/AbstractTime.st,v 1.22 1999-10-12 22:42:34 cg Exp $'
 ! !