AbstractTime.st
changeset 22913 c74635278990
parent 22884 3c29351e939e
child 22925 9748ba089af4
equal deleted inserted replaced
22912:c3476aa5226b 22913:c74635278990
  1166     aTimeOrTimeDurationOrNumberOfSeconds isNumber ifTrue:[
  1166     aTimeOrTimeDurationOrNumberOfSeconds isNumber ifTrue:[
  1167         "backward compatibility for old code, which expects (time1 - time2) to return seconds"    
  1167         "backward compatibility for old code, which expects (time1 - time2) to return seconds"    
  1168         otherMilliseconds := (aTimeOrTimeDurationOrNumberOfSeconds * 1000) asInteger.   "integer seconds"
  1168         otherMilliseconds := (aTimeOrTimeDurationOrNumberOfSeconds * 1000) asInteger.   "integer seconds"
  1169         otherPicos := 0.
  1169         otherPicos := 0.
  1170     ] ifFalse:[
  1170     ] ifFalse:[
       
  1171         self speciesForCompare = aTimeOrTimeDurationOrNumberOfSeconds speciesForCompare ifFalse:[   
       
  1172             ^ false        
       
  1173         ].
  1171         otherMilliseconds := aTimeOrTimeDurationOrNumberOfSeconds getMilliseconds.
  1174         otherMilliseconds := aTimeOrTimeDurationOrNumberOfSeconds getMilliseconds.
  1172         otherPicos := aTimeOrTimeDurationOrNumberOfSeconds additionalPicoseconds.
  1175         otherPicos := aTimeOrTimeDurationOrNumberOfSeconds additionalPicoseconds.
  1173     ].
  1176     ].
  1174     ^ (myMilliseconds = otherMilliseconds) and:[myPicos = otherPicos ].
  1177     ^ (myMilliseconds = otherMilliseconds) and:[myPicos = otherPicos ].
  1175 
  1178 
  1176     "
  1179     "
  1177         (Timestamp now + 10) - Timestamp now  = 10
  1180         (Timestamp now + 10) - Timestamp now  = 10
  1178         (Timestamp now + 10) - Timestamp now  = 9
  1181         (Timestamp now + 10) - Timestamp now  = 9
       
  1182 
       
  1183         (Timestamp now) = (Timestamp now + 10 - 10)
       
  1184         (Timestamp now) = (UtcTimestamp now)
  1179 
  1185 
  1180         (Time now + 10 seconds) - Time now  = 10
  1186         (Time now + 10 seconds) - Time now  = 10
  1181         (Time now + 10) - Time now          = 10
  1187         (Time now + 10) - Time now          = 10
  1182 
  1188 
  1183         (Time now + 10 seconds) > Time now 
  1189         (Time now + 10 seconds) > Time now 
  1331     "/ getting a non-number (the seconds). Therefore, for the meantime,
  1337     "/ getting a non-number (the seconds). Therefore, for the meantime,
  1332     "/ we return:
  1338     "/ we return:
  1333 
  1339 
  1334     "/ ^ aTimestamp getSeconds - self getSeconds
  1340     "/ ^ aTimestamp getSeconds - self getSeconds
  1335 ! !
  1341 ! !
       
  1342 
  1336 
  1343 
  1337 !AbstractTime methodsFor:'printing & storing'!
  1344 !AbstractTime methodsFor:'printing & storing'!
  1338 
  1345 
  1339 addBasicPrintBindingsTo:aDictionary language:languageOrNil
  1346 addBasicPrintBindingsTo:aDictionary language:languageOrNil
  1340     "private print support: add bindings for printing to aDictionary.
  1347     "private print support: add bindings for printing to aDictionary.