Timestamp.st
branchjv
changeset 17757 73caeb68bf1f
parent 17751 b2273fa8d59f
child 17761 b0e5971141bc
--- a/Timestamp.st	Sun Mar 21 19:37:43 2010 +0000
+++ b/Timestamp.st	Thu Apr 08 18:25:02 2010 +0100
@@ -107,7 +107,7 @@
                                          millisecond:millis)
 
     "
-     Timestamp UTCYear:1970 month:1 day:1 hour:1 minute:0 second:0 millisecond:0
+     Timestamp UTCYear:1970 month:1 day:1 hour:0 minute:0 second:0 millisecond:0
      Timestamp UTCYear:1991 month:1 day:2 hour:12 minute:30 second:0 millisecond:0
      Timestamp UTCYear:1991 month:1 day:2 hour:12 minute:30 second:0 millisecond:100
      Timestamp UTCYear:1999 month:7 day:1 hour:1 minute:0 second:0 millisecond:0
@@ -120,22 +120,20 @@
 !
 
 day:d month:m year:y hour:h minutes:min seconds:s
+    <resource: #obsolete>
     "This is obsolete. User #year:month:day:hour:minute:second:"
 
     ^ self 
         year:y month:m day:d hour:h 
         minute:min second:s millisecond:0
 
-    "
-     Timestamp day:2 month:1 year:1991 hour:12 minute:30 second:0 
-     Timestamp day:8 month:1 year:1995 hour:0 minute:43 second:48 
-    "
 
     "Modified: / 1.7.1996 / 15:22:26 / cg"
     "Modified: / 13.7.1999 / 12:29:56 / stefan"
 !
 
 day:d month:m year:y hour:h minutes:min seconds:s milliseconds:millis
+    <resource: #obsolete>
     "This is obsolete. User #year:month:day:hour:minute:second:millisecond:"
 
     ^ self year:y month:m day:d hour:h minute:min second:s millisecond:millis
@@ -191,7 +189,7 @@
         hour:aTime hours 
         minute:aTime minutes 
         second:aTime seconds 
-
+        millisecond:0
     "
      Timestamp fromDate:(Date today) andTime:(Time now)  
      Timestamp fromDate:(Date today plusDays:1) andTime:(Time now) 
@@ -614,7 +612,7 @@
      Timestamp year:1970 month:1 day:1 hour:1 minute:0 second:0 
      Timestamp year:1991 month:1 day:2 hour:12 minute:30 second:0 
      Timestamp year:1991 month:1 day:2 hour:12 minute:30 second:0 millisecond:100
-     Timestamp year:2000 month:1 day:1 hour:1 minutes:0 second:0 
+     Timestamp year:2000 month:7 day:1 hour:1 minute:0 second:0 
     "
 
     "Modified: / 1.7.1996 / 15:22:07 / cg"
@@ -636,7 +634,7 @@
      Timestamp year:1970 month:1 day:1 hour:0 minute:0 second:0 
      Timestamp year:1991 month:1 day:2 hour:12 minute:30 second:0 
      Timestamp year:1991 month:1 day:2 hour:12 minute:30 second:0 millisecond:100
-     Timestamp year:2000 month:1 day:1 hour:1 minute:0 second:0 
+     Timestamp year:2000 month:7 day:1 hour:1 minute:0 second:0 
     "
 
     "Modified: / 1.7.1996 / 15:22:07 / cg"
@@ -889,7 +887,6 @@
     "Created: / 16-06-2005 / 16:13:36 / masca"
 ! !
 
-
 !Timestamp methodsFor:'accessing'!
 
 day
@@ -1209,11 +1206,6 @@
     ^ self getMilliseconds
 !
 
-asNative
-	#swAdded.
-	^self
-!
-
 asSeconds
     "return the number of seconds elapsed since whatever time the
      OperatingSystem bases its time upon. Since this is totally
@@ -1402,7 +1394,12 @@
 
     |t off|
 
-    t := OperatingSystem computeTimeAndDateFrom:osTime.
+    isLocal ifTrue:[
+        t := OperatingSystem computeTimeAndDateFrom:osTime.
+    ] ifFalse:[
+        t := OperatingSystem computeUTCTimeAndDateFrom:osTime.
+    ].
+
     shortFormat ifTrue:[
         self assert:(t year between:1951 and:2049).
         (t year \\ 100) printOn:aStream leftPaddedTo:2 with:$0.
@@ -1438,6 +1435,7 @@
 
     "
      Timestamp now printGeneralizedOn:Transcript. Transcript cr. 
+     Timestamp now printGeneralizedOn:Transcript isLocal:true. Transcript cr. 
      (Timestamp fromSeconds:0) printGeneralizedOn:Transcript. Transcript cr.
      Time now printOn:Transcript. Transcript cr.           
      Date today printOn:Transcript. Transcript cr.        
@@ -1669,8 +1667,6 @@
     "
 ! !
 
-
-
 !Timestamp methodsFor:'visiting'!
 
 acceptVisitor:aVisitor with:aParameter
@@ -2430,11 +2426,11 @@
 !Timestamp class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Timestamp.st 10501 2010-02-13 23:34:44Z vranyj1 $'
+    ^ '$Id: Timestamp.st 10510 2010-04-08 17:25:02Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Timestamp.st,v 1.127 2010/02/10 17:47:27 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Timestamp.st,v 1.129 2010/03/31 09:41:13 stefan Exp §'
 ! !
 
 Timestamp initialize!
@@ -2442,3 +2438,4 @@
 
 
 
+