Timestamp.st
branchjv
changeset 17807 06cc6c49e291
parent 17780 b6e42c92eba0
child 17814 b75a7f0c346b
equal deleted inserted replaced
17806:a6c483ec9b9f 17807:06cc6c49e291
   554         ] ifFalse:[
   554         ] ifFalse:[
   555             ^ exceptionBlock value
   555             ^ exceptionBlock value
   556         ].
   556         ].
   557     ].
   557     ].
   558 
   558 
       
   559     utcOffset := 0.
   559     utcOffsetString := (parts at:6 + indexModifier).
   560     utcOffsetString := (parts at:6 + indexModifier).
   560     ((utcOffsetString sameAs:'GMT') or:[utcOffsetString sameAs:'UTC']) ifFalse:[ 
   561     ((utcOffsetString sameAs:'GMT') or:[utcOffsetString sameAs:'UTC']) ifFalse:[ 
   561         self assert:utcOffsetString size == 5.
   562         self assert:utcOffsetString size == 5.
   562 
   563 
   563         utcOffset := (utcOffsetString from:4 to:5) asString asNumber * 60.
   564         utcOffset := (utcOffsetString from:4 to:5) asString asNumber * 60.
   577         (Date abbreviatedNameOfMonth:i language:#en) sameAs:monthName 
   578         (Date abbreviatedNameOfMonth:i language:#en) sameAs:monthName 
   578     ] ifNone:[^ exceptionBlock].    
   579     ] ifNone:[^ exceptionBlock].    
   579 
   580 
   580     ^ (Timestamp 
   581     ^ (Timestamp 
   581         fromDate:(Date newDay:day monthIndex:month year:year) 
   582         fromDate:(Date newDay:day monthIndex:month year:year) 
   582         andTime:time) + utcOffset       
   583         andTime:time) + utcOffset
       
   584 
       
   585     "Modified: / 05-10-2010 / 16:05:32 / cg"
   583 !
   586 !
   584 
   587 
   585 secondsSince1970:sec
   588 secondsSince1970:sec
   586     "set time from elapsed seconds since 1-1-1970, 0:0:0.
   589     "set time from elapsed seconds since 1-1-1970, 0:0:0.
   587      This is the format used in the UNIX world"
   590      This is the format used in the UNIX world"
  2431 ! !
  2434 ! !
  2432 
  2435 
  2433 !Timestamp class methodsFor:'documentation'!
  2436 !Timestamp class methodsFor:'documentation'!
  2434 
  2437 
  2435 version
  2438 version
  2436     ^ '$Id: Timestamp.st 10544 2010-07-12 16:20:36Z vranyj1 $'
  2439     ^ '$Id: Timestamp.st 10590 2010-11-09 16:24:28Z vranyj1 $'
  2437 !
  2440 !
  2438 
  2441 
  2439 version_CVS
  2442 version_CVS
  2440     ^ 'Header: /cvs/stx/stx/libbasic/Timestamp.st,v 1.130 2010/07/10 07:37:34 cg Exp '
  2443     ^ 'Header: /cvs/stx/stx/libbasic/Timestamp.st,v 1.131 2010-10-05 14:40:57 cg Exp '
  2441 !
  2444 !
  2442 
  2445 
  2443 version_SVN
  2446 version_SVN
  2444     ^ '$Id: Timestamp.st 10544 2010-07-12 16:20:36Z vranyj1 $'
  2447     ^ '$Id: Timestamp.st 10590 2010-11-09 16:24:28Z vranyj1 $'
  2445 ! !
  2448 ! !
  2446 
  2449 
  2447 Timestamp initialize!
  2450 Timestamp initialize!
  2448 
  2451 
  2449 
  2452 
  2450 
  2453 
       
  2454