Timestamp.st
changeset 24809 e347fb41b7d7
parent 24597 435fc9fbc45e
child 24850 8048f0088a90
--- a/Timestamp.st	Sat Sep 28 15:53:21 2019 +0200
+++ b/Timestamp.st	Sat Sep 28 15:54:47 2019 +0200
@@ -682,15 +682,13 @@
      mantissa fraction picos ts
      monthName|
 
-    aStream skipSeparators.
-    aStream peek isLetter ifTrue:[
+    aStream skipSeparators isLetter ifTrue:[
         "/ US format, like 'July 21, 1983 01:15:00' ?
         monthName := aStream throughAnyForWhich:[:ch | ch isLetter].
         month := Date indexOfMonth:monthName asLowercase.
         aStream skipSeparators.
         day := Integer readFrom:aStream onError:-1.
-        aStream skipSeparators.
-        aStream peek == $, ifTrue:[
+        aStream skipSeparators == $, ifTrue:[
             aStream next
         ].
     ] ifFalse:[
@@ -700,10 +698,9 @@
             "/ assume iso8601 format;
             ^ self readIso8601FormatFrom:aStream yearAlreadyRead:firstNumber.
         ].
-        aStream skipSeparators.
 
         "/ consider this a kludge
-        usFormat := (aStream peek == $/ ).
+        usFormat := aStream skipSeparators == $/.
 
         [(ch := aStream peekOrNil) notNil and:[ch isLetterOrDigit not]] whileTrue:[aStream next].
         (ch notNil and:[ch isDigit]) ifTrue:[
@@ -834,6 +831,7 @@
 
     "Modified: / 09-11-2017 / 10:10:07 / cg"
     "Modified: / 14-12-2018 / 19:22:17 / Claus Gittinger"
+    "Modified: / 28-09-2019 / 15:24:25 / Stefan Vogel"
 !
 
 readIso8601FormatFrom:aStringOrStream yearAlreadyRead:yearOrNil
@@ -1214,7 +1212,7 @@
     [formatStream atEnd] whileFalse:[
         fChar := formatStream next.
         fChar = Character space ifTrue:[
-            inStream peek isSeparator ifFalse:[ error value: 'format error; space expcected' ].
+            inStream peek isSeparator ifFalse:[ error value: 'format error; space expeccted' ].
             inStream skipSeparators.
         ] ifFalse:[
             fChar == $% ifTrue:[
@@ -1299,7 +1297,7 @@
      Timestamp readFrom:'20-2-1995 13:11:06.12345' format:'%day-%month-%year %h:%m:%s.%f' language:nil onError:[self halt]
     "
 
-    "Modified: / 27-07-2018 / 11:57:59 / Stefan Vogel"
+    "Modified: / 28-09-2019 / 15:25:17 / Stefan Vogel"
 !
 
 readFrom:aStringOrStream onError:exceptionBlock
@@ -1933,9 +1931,8 @@
     |ch offset stream|
 
     stream := aStringOrStream readStream.
-    stream skipSeparators.
-
-    ch := stream peekOrNil.
+
+    ch := stream skipSeparators.
     ch isNil ifTrue:[^ 0].
 
     ch isLetter ifTrue:[
@@ -1986,6 +1983,8 @@
      self utcOffsetFrom:'+1:30'
      self utcOffsetFrom:'+01'
     "
+
+    "Modified: / 28-09-2019 / 15:25:45 / Stefan Vogel"
 !
 
 utcOffsetFromString:aString