Bug in Calendar Module

Harald Hanche-Olsen hanche at math.ntnu.no
Sun Jan 23 13:03:55 EST 2000


+ Michael Tiomkin <michael at camelot-it.com>:

|   Unfortunately, this is a bug.  The overflow exists only when you
| treat the time as a signed 32-bit integer.

But certainly every Unix system on which I ever bothered to check
this, time_t is a *signed* 32-bit quantity, allowing times from
1901-12-13 20:45:52 UTC to 2038-01-19 03:14:07 UTC inclusive.

| When you use time as unsigned integer, this will happen only around
| 1970+2**32/3e7, 2090?

Rollover will then happen at 2106-02-07 06:28:15 UTC, to be precise.
However, this solution offers no way to represent times prior to the
unix epoch.

| Ben Gertzfield wrote:
| 
| > There isn't a good solution, except to use a system that has a
| > 64-bit counter for time.

Indeed.  And I am sure all unixes will do so long before 2038.  That
way, rollover will not happen until 504140796-12-04 15:30:08 UTC, if
they are still using the Gregorian calendar at that time.

Which-is-a-safe-bet-they-wont-ly y'rs,
-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- "There arises from a bad and unapt formation of words
   a wonderful obstruction to the mind."  - Francis Bacon



More information about the Python-list mailing list