--- a/Timestamp.st Tue Oct 22 14:23:48 2019 +0200
+++ b/Timestamp.st Tue Oct 22 19:29:12 2019 +0200
@@ -1473,29 +1473,24 @@
str peek == $: ifTrue:[ str next].
min:= Integer readFrom:(str next:2).
(min between:0 and:59) ifFalse:[^ exceptionBlock value].
- str atEnd ifFalse:[
- str peek == $: ifTrue:[ str next].
- sec := Integer readFrom:(str next:2).
- (sec between:0 and:59) ifFalse:[^ exceptionBlock value].
- str atEnd ifFalse:[
- str peek == $. ifTrue:[
- str next.
- "/ the old code here was wrong in assuming that exactly 3 digits
- "/ are coming; thus hh:mm:ss.1 was interpreted as 1ms (instead of 100)
- "/ thus: count the zeros...
- str peek isDigit ifTrue:[
- fraction := Number readMantissaFrom:str radix:10.
- fraction isNil ifTrue:[^ exceptionBlock value].
- millis := (fraction * 1000) rounded.
- ] ifFalse:[
- millis := 0
- ].
- ].
- str skipSeparators.
+ str peekOrNil == $: ifTrue:[ str next].
+ sec := Integer readFrom:(str next:2).
+ (sec between:0 and:59) ifFalse:[^ exceptionBlock value].
+ str peekOrNil == $. ifTrue:[
+ str next.
+ "/ the old code here was wrong in assuming that exactly 3 digits
+ "/ are coming; thus hh:mm:ss.1 was interpreted as 1ms (instead of 100)
+ "/ thus: count the zeros...
+ str peek isDigit ifTrue:[
+ fraction := Number readMantissaFrom:str radix:10.
+ fraction isNil ifTrue:[^ exceptionBlock value].
+ millis := (fraction * 1000) rounded.
+ ] ifFalse:[
+ millis := 0
].
].
- str atEnd ifTrue:[
+ str skipSeparators isNil ifTrue:[
"/ this is local time
newTime := self year:year month:month day:day
hour:hour minute:min second:sec millisecond:millis.
@@ -1562,6 +1557,7 @@
"Modified: / 13-07-1999 / 12:31:14 / stefan"
"Modified: / 22-08-2006 / 12:30:11 / cg"
+ "Modified: / 22-10-2019 / 16:09:25 / Stefan Vogel"
!
readISO8601From:aStringOrStream