Date Conversion problem: Date == 2079/12/31
jwilhelm at outsourcefinancial.com
Mon Aug 19 17:49:33 CEST 2002
On Mon, 2002-08-19 at 06:45, Bradley D. Larson wrote:
> I have been using Python to supplement an MRP called Fourth Shift
> with great success until now....
> Fourth Shift utilizes 2079/12/31 as the "end of time" for items that
> do not expire. Unfortunately the python "time" lib does not handle
> this date. I have attempted to convert the date to something else
> in the sql call (eg. to_date(out_date,'YYYYMMDD')) but this does
> not appear to be supported in the Fourth Shift ODBC/DB calls.
> Does anyone know if this date is pushed back farther in python 2.2?
> Or do you know of a work around...
> Brad Larson
Actually, this looks like an integer size limitation, oddly enough.
Apparently date handling is done explicitly with integers:
>>> time.ctime( sys.maxint )
'Mon Jan 18 20:14:07 2038'
>>> time.ctime( float( sys.maxint ) + 1.0 )
'Fri Dec 13 13:45:52 1901'
So you will end up getting an OverflowError with any date higher than
Just a guess. :)
More information about the Python-list