Timestamp.st
changeset 7004 6cd2080ea0a3
parent 6955 adc3cc02fd7e
child 7006 8813a36f7645
--- a/Timestamp.st	Tue Feb 04 12:23:09 2003 +0100
+++ b/Timestamp.st	Tue Feb 04 18:36:26 2003 +0100
@@ -591,7 +591,6 @@
     "Modified: / 13.7.1999 / 12:37:57 / stefan"
 ! !
 
-
 !AbsoluteTime methodsFor:'accessing'!
 
 day
@@ -893,7 +892,7 @@
 
     ^ self getSeconds
 
-    "
+    "                                                 
      AbsoluteTime now asSeconds
      AbsoluteTime fromSeconds:(AbsoluteTime now asSeconds + 3600) 
      Time hour:23 minutes:33 seconds:0         
@@ -914,6 +913,21 @@
     "
 !
 
+asUTCSecondsSince1901
+    "return the number of seconds elapsed since Jan, 1st 1901"
+
+    |daysBetween1901and1970 secondsPerDay|
+
+    daysBetween1901and1970 := (Date day:1 month:1 year:1970) subtractDate:(Date day:1 month:1 year:1901).
+    secondsPerDay := 24 * 60 * 60.
+    ^ self utcSecondsSince1970 " since 1.1.1970 "
+      + (daysBetween1901and1970 * secondsPerDay).  
+
+    "                                                 
+     AbsoluteTime now asSecondsSince1901 
+    "
+!
+
 literalArrayEncoding
     "encode myself as an array, from which a copy of the receiver
      can be reconstructed with #decodeAsLiteralArray.
@@ -1151,9 +1165,8 @@
     "
 ! !
 
-
 !AbsoluteTime class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Timestamp.st,v 1.70 2003-01-17 17:43:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Timestamp.st,v 1.71 2003-02-04 17:36:26 penk Exp $'
 ! !