Date today is wrong!?

John Clonts jclonts at mastnet.net
Tue May 16 18:24:09 UTC 2000


Gerardo Richarte wrote:
> 
> Hi! Leandro found this:
> 
>     Today is '16 May 2000', but my Squeak is answering '15 May 2000'...
> 
>     On my squeak (On Windows NT)
> 
>     Time primSecondsClock = 3135851829 "that is smaller than"
>     (Date newDay: 16 month: 5 year: 2000) asSeconds = 3135888000.
> 
>     It looks like something is wrong with the primitive... or windows?
> or
> conversion from seconds to days... I'm not sure...

Yes indeed, its a bug in the Windows code.  The fix for the time being
is

Time class>>dateAndTimeNow
	"Answer a two-element Array of (Date today, Time now)."

	| secondCount d t |
	secondCount _ self primSecondsClock + 86400. " jcc patch for
primsecondsclock bug 2/29/2000"
	d _ Date fromSeconds: secondCount.
	t _ Time fromSeconds: secondCount \\ 86400.
	^ Array with: d with: t

Cheers,
John

-- 

[:o|] Buster BlockBlaster





More information about the Squeak-dev mailing list