Date Conversion problem: Date == 2079/12/31 
Author Message
 Date Conversion problem: Date == 2079/12/31

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

  blarson.vcf
< 1K Download


Fri, 04 Feb 2005 21:45:58 GMT  
 Date Conversion problem: Date == 2079/12/31
"Bradley D. Larson" wrote

Quote:

> 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...

Hye-Shik Chang wrote a patch to calendar.py that expands the
date range.  See www.python.org/sf/483864

Raymond Hettinger



Fri, 04 Feb 2005 23:44:54 GMT  
 Date Conversion problem: Date == 2079/12/31

Quote:

> 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:

Quote:
>>> time.ctime( sys.maxint )

'Mon Jan 18 20:14:07 2038'
Quote:
>>> 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
that.

Just a guess. :)

--Joseph Wilhelm



Fri, 04 Feb 2005 23:49:33 GMT  
 Date Conversion problem: Date == 2079/12/31

Quote:

> 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.

Where were the developers of that product 3 years ago?  Did they
really miss the whole Y2K thing?  Or did they just learn nothing
from the whole sorry episode?  It's sad, really...

-Peter



Sat, 05 Feb 2005 07:20:14 GMT  
 Date Conversion problem: Date == 2079/12/31

Quote:
> 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...

All you need is a Date class that's independent of the "time" module.
There's one in the Python demo folder, or you could use mine
(http://forums.delphiforums.com/infinite_loops/messages/?msg=2579.1).


Sat, 05 Feb 2005 09:59:48 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Problem with Clarion Date Conversion Algorithm

2. Date Conversion Problem

3. Invalid dates - 215 using Btrieve/Clipper DATE format

4. how to convert clarion date to sql date

5. Create Time / date or Modified Time / date of a txt file

6. Clarion date to MS SQL date.

7. Dataflex dates to Clarion dates

8. CW2.003 File copy changes the date.....need a way to copy w/o date change

9. Clarion Date (Long) -> Access Date\Time

10. Converting dates exported by CCVT to DBF dates

11. convert labview date/time to excel date/time

 

 
Powered by phpBB® Forum Software