[Pkg] The Trunk: Kernel-tfel.383.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 28 06:35:20 UTC 2010


Andreas Raab uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-tfel.383.mcz

==================== Summary ====================

Name: Kernel-tfel.383
Author: tfel
Time: 28 January 2010, 2:37:15.04 am
UUID: 7b9f7929-2ba0-4997-bac3-23868341cb31
Ancestors: Kernel-ul.382

Seems that (according to ISO8601) reading a Time from a stream without explicit UTC offset should not assume the local timezone, but rather UTC. 
This fixes DateAndTimeTest>>#testReadFrom

=============== Diff against Kernel-ul.382 ===============

Item was changed:
  ----- Method: DateAndTime class>>readFrom: (in category 'squeak protocol') -----
  readFrom: aStream
  
  	| offset date time ch |
  
  	date := Date readFrom: aStream.
  	[aStream peek isDigit]
  		whileFalse: [aStream next].
  	time := Time readFrom: aStream.
  	aStream atEnd
+ 		ifTrue: [ offset := Duration zero ]
- 		ifTrue: [ offset := self localOffset ]
  		ifFalse: [
  			ch := aStream next.
  			ch = $+ ifTrue: [ch := Character space].
  			offset := Duration fromString: ch asString, '0:', aStream upToEnd, ':0'].
  		
  	^ self
  		year: date year
  		month: date monthIndex
  		day: date dayOfMonth
  		hour: time hour
  		minute: time minute
  		second: time second
  		nanoSecond: time nanoSecond
  		offset: offset
  
  
  	"	'-1199-01-05T20:33:14.321-05:00' asDateAndTime
  		' 2002-05-16T17:20:45.1+01:01' asDateAndTime
  
  		' 2002-05-16T17:20:45.02+01:01' asDateAndTime
  
  		' 2002-05-16T17:20:45.003+01:01' asDateAndTime
  
  		' 2002-05-16T17:20:45.0004+01:01' asDateAndTime
    		' 2002-05-16T17:20:45.00005' asDateAndTime
  		' 2002-05-16T17:20:45.000006+01:01' asDateAndTime
  
  		' 2002-05-16T17:20:45.0000007+01:01' asDateAndTime
  		' 2002-05-16T17:20:45.00000008-01:01' asDateAndTime   
  		' 2002-05-16T17:20:45.000000009+01:01' asDateAndTime  
  		' 2002-05-16T17:20:45.0000000001+01:01' asDateAndTime  
  
   		' 2002-05-16T17:20' asDateAndTime
  		' 2002-05-16T17:20:45' asDateAndTime
  		' 2002-05-16T17:20:45+01:57' asDateAndTime
   		' 2002-05-16T17:20:45-02:34' asDateAndTime
   		' 2002-05-16T17:20:45+00:00' asDateAndTime
  		' 1997-04-26T01:02:03+01:02:3' asDateAndTime 
   	"!



More information about the Packages mailing list