#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sun, 26 May 2019 11:59:50 +0200
changeset 24160 93d4db241317
parent 24159 f3f05b723a29
child 24161 cfa3f53b41d9
#FEATURE by cg class: Timestamp class added: #year:day:
Timestamp.st
--- a/Timestamp.st	Sun May 26 11:37:39 2019 +0200
+++ b/Timestamp.st	Sun May 26 11:59:50 2019 +0200
@@ -523,6 +523,7 @@
     "Modified: / 13.7.1999 / 12:37:57 / stefan"
 ! !
 
+
 !Timestamp class methodsFor:'Compatibility-Squeak'!
 
 current
@@ -548,6 +549,21 @@
     "Modified (format): / 14-12-2018 / 19:14:16 / Claus Gittinger"
 !
 
+year:year day:dayInYear
+    "return a new Timestamp, given the year and the day-in-year (starting at 1).
+     See also: Date today / Time now / Timestamp now.
+     Squeak compatibility"
+
+    ^ self newDay:dayInYear year:year
+
+    "
+     self year:1970 day:1
+     self year:2000 day:1
+    "
+
+    "Created: / 26-05-2019 / 11:59:20 / Claus Gittinger"
+!
+
 year: year month: month day: day hour: hour minute: minute second: second millisecond: millisecond offset:timeDuration
     ^ (UtcTimestamp year: year month: month day: day hour: hour minute: minute second: second millisecond: millisecond)
         utcOffset:timeDuration
@@ -1975,6 +1991,8 @@
 
 
 
+
+
 !Timestamp methodsFor:'accessing'!
 
 day