CurrentDate boundary causes MAV

Archives Forums/Blitz3D Bug Reports/CurrentDate boundary causes MAV

_PJ_(Posted 2009) [#1]
Not sure on the spercifics, but it may be based on Windows' settings for the hundred year start and end for displaying two-digit year formats.

Anyway , it also may never be a problem for most people, but jsut in case:

1) Set System Time in Windows to 1st January 2050 (This is a typical value that gave the error for me, not sure on others)

2) Any calls to CurrentDate() will now result in a MAV error.


_PJ_(Posted 2009) [#2]
Did a little bit of testing...

Windows (XP Home Edition SP.3) has a limit on the time/date settings. Currently, 1980 to 2099 for the year.

This is irrespective of my regional settings where I have set the 2-figure year values from 1976 to 2075.

The MAV only appears with dates > year 2037

I've not messed with days/months yet.


Floyd(Posted 2009) [#3]
The MAV only appears with dates > year 2037

That's weird.

2038 is the Unix version of Y2K. But what does that have to do with Blitz3D and Windows?


xlsior(Posted 2009) [#4]
The UNIX 2038 problem is due to it storing the time as the # of seconds that passed since 00:00:00 UTC on January 1st, 1970.
This value is stored in a 32 bit value, which will roll over to negatives on 03:14:07 UTC on Tuesday, January 19th 2038.

If B3D uses a similar internal time counter while storing the results in an int, then it's quite likely that it too suffers from an overflow condition causing the MAV or other weird effects.


_PJ_(Posted 2009) [#5]
After a little more checking on the day, month and time, this seems to be it, well spotted Floyd and xlsior!
At least, got a few years yet, but it does indicate some inherent obsolescence which could be problematic when the time comes.
I wonder if there's any known workarounds, perhaps grabbing the system date by 'Peek'ing somewhere?