[Bug][Fix]Date today->March 1, 2000 (Bug in Windows VM)
Juan Manuel Vuletich
jmvuletich at sinectis.com.ar
Sat Mar 4 00:36:40 UTC 2000
Hi folks
I got the same problem on OS/2. The problem is in the Windows VM.
I took the code when I wrote the OS/2 version, and may be it will happen on some other platform.
In sqWin32Directory.c>>DWORD convertToSqueakTime(SYSTEMTIME st) it does
dy = st.wYear - 1901; /* compute delta year */
and a bit after
/* check if month > 2 and current year is a leap year */
if(st.wMonth > 2 && (dy & 0x0003) == 0)
secs += 24 * 60 * 60; /* add one day */
The problem is that it's taking as leap years 1993, 1997, 2001, 2003, etc.
The fix is to make it like this:
/* check if month > 2 and current year is a leap year */
if(st.wMonth > 2 && (dy & 0x0003) == 0x0003)
secs += 24 * 60 * 60; /* add one day */
That's all.
Unfortunately, it's needed to rebuild the VM (I'm doing it for OS/2, but don't have a Windows environment).
Andreas, can you?
Juan Manuel Vuletich
More information about the Squeak-dev
mailing list
|