Portable general timestamp format, not 2038-limited

Wojtek nowhere at a.com
Thu Jul 5 16:57:32 EDT 2007


James Harris wrote :
> I have a requirement to store timestamps in a database. Simple enough
> you might think but finding a suitably general format is not easy. The
> specifics are
>
> 2) not bounded by Unix timestamp 2038 limit

I use the Java Calendar class for storing dates, which as I understand 
it, uses a long to store the date/time/milliseconds.

In my application I use the date 9999.12.31 23:59:59.000 to store a 
blank date. Calendar has no problem storing that date, and returning 
the correct year, month, day, hour, minute, and second.

Note: Since I am using the year 9999 as a "magic number", some of you 
may think that I am repeating the Y2K problem. Hey, if my application 
is still being used in the year 9998 I am not being paid nearly 
enough...

-- 
Wojtek :-)





More information about the Python-list mailing list