[Glass] Timespan Month questions

Johan Brichau via Glass glass at lists.gemtalksystems.com
Thu Jun 25 06:02:38 PDT 2015


Hi Dario,

What timezone is your image configured in? 

	TimeZone current standardPrintString

DateAndTime in GemStone take the DST (daylight saving time) into account.
If you create a DateAndTime on a particular date, it will automatically adapt the offset to UTC to reflect that.

April 1st is still winter time (UTC+1) and April 30th is summer time (UTC+2). 
In Belgium this happens is in March, so I am a bit surprised about the dates you report, which is why I ask which timezone you are in.

Mind that the two datetimes you mention are _not_ the same (see the value of seconds). 
Comparing datetimes from different timezones works relative to UTC time. 

Does that answer your question?

cheers
Johan



> On 25 Jun 2015, at 12:01, Trussardi Dario Romano via Glass <glass at lists.gemtalksystems.com> wrote:
> 
> Ciao,
> 
> 	i have a problem when i use a Month class into glass.
> 
> 	The	:		( Month starting: ( Date fromString: '04.01.2015' )) 
> 
> 	answer the:
> 
> 	{c} .         -> April 2015
> 		(class)@  -> Month
> 
> 		(oop)@    -> 186660865
> 
> 		duration@ -> 30:00:00:00
> 
> 		start@    -> 2015-04-01T00:00:00+01:00
> 
> 	The relative start@ is set to:
> 
> 
> 		.        -> 2015-04-01T00:00:00+01:00
> 			..       -> April 2015
> 
> 			(class)@ -> DateAndTime
> 
> 			(oop)@   -> 231252225
> 
> 			offset@  -> 3600					( NOTE IT'S SET TO 3600 )
> 
> 			seconds@ -> 449535600
> 
>  
> 
> 
> 	Now when i do:	( Month starting: ( Date fromString: '04.01.2015' )) end
> 
> 		the system answer:
> 
> 	.        -> 2015-04-30T23:59:59.99999898672104+02:00
> 		(class)@ -> DateAndTime
> 
> 		(oop)@   -> 231902721
> 
> 		offset@  -> 7200
> 
> 		seconds@ -> 4,5212399999999899E+08
> 
>  
> 
> 	I don't understund because the end method answer aDateAndTime with offset set to 7200.
> 
> 	
> 	After what in my code  i have two DateAndTime instance relative to the same " time " :
> 
> 	{a} .        -> 2015-04-30T23:59:59.99999898672104+02:00
> 			(class)@ -> DateAndTime
> 
> 			(oop)@   -> 324717569
> 
> 			offset@  -> 7200
> 
> 			seconds@ -> 4,5212399999999899E+08
> 
> 
> 	{b} .        -> 2015-04-30T23:59:59.99999898672104+01:00
> 			(class)@ -> DateAndTime
> 
> 			(oop)@   -> 324726017
> 
> 			offset@  -> 3600
> 
> 			seconds@ -> 4,5212759999999899E+08
> 
>  	but the comparing methods:  ( aDateAndTime{b} asDateAndTime between: start{c} and: self end {a} )
> 
> 	rightly, don't answer as i expect.
> 
> 
> 
> 	Considerations ?
> 
> 	Thanks,
> 
> 		Dario
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150625/39c09367/attachment-0001.html>


More information about the Glass mailing list