[GemStone-Smalltalk] Possible Date bug in GS64 3.1 or 3.x??

James Foster james.foster at gemtalksystems.com
Wed May 7 15:44:38 PDT 2014


The comment for Date class>>#’today’ is: "Creates and returns an instance of the receiver from the system calendar on the machine that is running the Gem process, which is assumed to represent the current date."

Are both databases running on the same server? What is the TZ setting for the server? 

Date today. "05/07/2014"
TimeZone sampleTokyo installAsCurrentTimeZone. “JST"
DateTime now. "08/05/2014 07:37:03"
Date today. "05/07/2014”
DateAndTime now. "2014-05-08T07:38:29.0072650909423+09:00"
System performOnServer: 'date'. ‘"Wed May  7 15:39:19 PDT 2014”
TimeZone default installAsCurrentTimeZone. "PST"
DateTime now. "07/05/2014 15:40:56”

I think that Date is behaving as it is documented to behave and if you want TimeZone consideration then you need to use a class that deals with TimeZone.

James

On May 7, 2014, at 12:42 PM, Dennis Smith <dennis at CherniakSoftware.com> wrote:

> In 3.x "Time now" was corrected to take into account the Gemstone current TimeZone -- that was nice, fixed
> a problem we had, so I copied the fix to 2.x and it worked.
> 
> However, in both 2.x and the 3.1.0.2 that we are using, "Date today" does not have a similar fix, so you get strange results.
> 
> We have a client with 2 databases.  The client is in Vancouver which is "PST", and one GS is PST but the other is MST, which is one our East.
> 
> So we get
>    May 7 11:59pm    ->     May 7 00:01am   ->   May 8 01:00 am
> 
> In other words the date does not slip over until 1am.
> 
> It was simple enough to get "Date today" from "DateAndTime" like "Time now".
> 
> So, maybe this is fixed in a later 3.x??   I don't have one to look at.
> 
> -- 
> Dennis Smith
> Cherniak Software Development Corporation
> Phone  416.798.7948 ext 314
> Email  dennis at cherniaksoftware.com
> 
> _______________________________________________
> GemStone-Smalltalk mailing list
> GemStone-Smalltalk at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk



More information about the GemStone-Smalltalk mailing list