AbstractTime.st
changeset 25315 8227a9ce831d
parent 24423 27a335bed151
--- a/AbstractTime.st	Tue Mar 03 16:23:05 2020 +0100
+++ b/AbstractTime.st	Tue Mar 03 17:50:41 2020 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
               All Rights Reserved
@@ -1659,6 +1661,7 @@
         %T      seconds from midNight  (unpadded)
 
         %(TZD)  timeZone delta of the receiver from UTC in the format +/-hh:mm
+        %(TZD822) timeZone delta of the receiver from UTC in the(RFC822-)format +/-hhmm
 
         %(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
@@ -1727,7 +1730,7 @@
 
     "
 
-    |usHours ampm s zone tzDelta|
+    |usHours ampm s zone tzDelta s0 s1 s2 s822|
 
     self addBasicPrintBindingsTo:aDictionary language:languageOrNil.
     zone := self timeZoneName.
@@ -1738,7 +1741,6 @@
     aDictionary at:$U put:usHours.
     aDictionary at:$u put:(usHours leftPaddedTo:2 with:$0).
 
-
     aDictionary at:$a put:ampm.
     aDictionary at:$A put:ampm asUppercase.
     aDictionary at:$z put:zone.
@@ -1746,12 +1748,17 @@
 
     tzDelta == 0 ifTrue:[
         s := 'Z'.
+        s822 := '+0000'
     ] ifFalse:[
-        s := tzDelta < 0 ifTrue:[ '-' ] ifFalse:[ '+' ].
+        s0 := tzDelta < 0 ifTrue:[ '-' ] ifFalse:[ '+' ].
         tzDelta := tzDelta abs.
-        s := s  , ((tzDelta // 60) printStringLeftPaddedTo:2 with:$0),
-            ':' , ((tzDelta \\ 60) printStringLeftPaddedTo:2 with:$0).
+        
+        s1 := ((tzDelta // 60) printStringLeftPaddedTo:2 with:$0).
+        s2 := ((tzDelta \\ 60) printStringLeftPaddedTo:2 with:$0).
+        s := s0, s1, ':', s2.
+        s822 := s0, s1, s2.
     ].
+    aDictionary at:#TZD822 put:s822.
     aDictionary at:#TZD put:s
 
 
@@ -1761,6 +1768,8 @@
       Timestamp now addPrintBindingsTo:dict language:#en.
       dict inspect
     "
+
+    "Modified (format): / 03-03-2020 / 17:49:57 / Stefan Vogel"
 !
 
 printIso8601CompressedOn:aStream