RegressionTests__TimeAndDateTest.st
changeset 1940 8e0e4fbf523d
parent 1927 ac82d7231d95
child 1992 5cfaf842bed0
equal deleted inserted replaced
1939:9a6e4956515f 1940:8e0e4fbf523d
   185     "
   185     "
   186      self new test_01c_ReadingTimeStamps
   186      self new test_01c_ReadingTimeStamps
   187     "
   187     "
   188 
   188 
   189     "Created: / 09-11-2017 / 10:19:19 / cg"
   189     "Created: / 09-11-2017 / 10:19:19 / cg"
       
   190 !
       
   191 
       
   192 test_01d_ReadingTimeStamps
       
   193     |t|
       
   194 
       
   195     self assert:(t := Timestamp readFrom:'2017-11-09 10:18:03.236') printStringIso8601Format = '2017-11-09T10:18:03.236'.
       
   196     self assert:(t isLocalTimestamp).
       
   197     self assert:(t isUtcTimestamp not).
       
   198     self assert:(t isTZTimestamp not).
       
   199     
       
   200     self assert:(t := Timestamp readFrom:'2017-11-09 10:18:03.236Z') printStringIso8601Format = '2017-11-09T10:18:03.236Z'.
       
   201     self assert:(t isLocalTimestamp not).
       
   202     self assert:(t isUtcTimestamp).
       
   203     self assert:(t isTZTimestamp not).
       
   204 
       
   205     self should:[ Timestamp readFrom:'2017-11-09 10:18:03.236+1'] raise:Error.
       
   206     self should:[ Timestamp readIso8601FormatFrom:'2017-11-09 10:18:03.236+1'] raise:TimeConversionError.
       
   207     
       
   208     self assert:(t := Timestamp readFrom:'2017-11-09 10:18:03.236+01') printStringIso8601Format = '2017-11-09T10:18:03.236+01'.
       
   209     self assert:(t isLocalTimestamp not).
       
   210     self assert:(t isUtcTimestamp not).
       
   211     self assert:(t isTZTimestamp).
       
   212 
       
   213     "
       
   214      self new test_01d_ReadingTimeStamps
       
   215     "
       
   216 
       
   217     "Created: / 24-05-2018 / 17:45:08 / Claus Gittinger"
   190 !
   218 !
   191 
   219 
   192 test_02_ReadingDates
   220 test_02_ReadingDates
   193 
   221 
   194      self assert:(Date
   222      self assert:(Date