UtcTimestamp.st
changeset 16931 c62ad93254c2
parent 16715 5528600b6497
child 16969 e5da107ac771
equal deleted inserted replaced
16930:66a377261f90 16931:c62ad93254c2
    60 ! !
    60 ! !
    61 
    61 
    62 !UtcTimestamp methodsFor:'accessing'!
    62 !UtcTimestamp methodsFor:'accessing'!
    63 
    63 
    64 timeInfo
    64 timeInfo
       
    65     osTime < 0 ifTrue:[
       
    66         self halt:'timestamp out of OS range'.
       
    67         "/ TODO:
       
    68         "/ get timeInfo of epoche,
       
    69         "/ manually adjust d.m.y and h.m.s from the negative osTime.
       
    70     ].
       
    71 
    65     ^ OperatingSystem computeUTCTimeAndDateFrom:osTime
    72     ^ OperatingSystem computeUTCTimeAndDateFrom:osTime
    66 !
    73 !
    67 
    74 
    68 timeZoneName
    75 timeZoneName
    69     ^ #utc
    76     ^ #utc
    83     ^ self
    90     ^ self
    84 ! !
    91 ! !
    85 
    92 
    86 !UtcTimestamp methodsFor:'initialization'!
    93 !UtcTimestamp methodsFor:'initialization'!
    87 
    94 
    88 year:y month:m day:d hour:h minute:min second:s millisecond:millis 
    95 setOSTimeFromYear:y month:m day:d hour:h minute:min second:s millisecond:millis 
    89     osTime := OperatingSystem 
    96     osTime := OperatingSystem 
    90                 computeOSTimeFromUTCYear:y
    97                 computeOSTimeFromUTCYear:y month:m day:d
    91                 month:m
    98                 hour:h minute:min second:s
    92                 day:d
       
    93                 hour:h
       
    94                 minute:min
       
    95                 second:s
       
    96                 millisecond:millis
    99                 millisecond:millis
    97 
   100 
    98     "
   101     "
    99      UtcTimestamp now   
   102      UtcTimestamp now   
   100      Timestamp now      
   103      Timestamp now      
   118 ! !
   121 ! !
   119 
   122 
   120 !UtcTimestamp class methodsFor:'documentation'!
   123 !UtcTimestamp class methodsFor:'documentation'!
   121 
   124 
   122 version_CVS
   125 version_CVS
   123     ^ '$Header: /cvs/stx/stx/libbasic/UtcTimestamp.st,v 1.6 2014-07-09 16:20:18 cg Exp $'
   126     ^ '$Header: /cvs/stx/stx/libbasic/UtcTimestamp.st,v 1.7 2014-11-06 15:48:24 cg Exp $'
   124 ! !
   127 ! !
   125 
   128