Portable general timestamp format, not 2038-limited

Carsten Haese carsten at uniqsys.com
Fri Jun 22 16:52:22 EDT 2007


On Fri, 2007-06-22 at 13:33 -0700, 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
> 
> 1) subsecond resolution - milliseconds or, preferably, more detailed
> 2) not bounded by Unix timestamp 2038 limit
> 3) readable in Java
> 4) writable portably in Perl which seems to mean that 64-bit values
> are out
> 5) readable and writable in Python
> 6) storable in a free database - Postgresql/MySQL

PostgreSQL timestamps do not appear to be limited by Y2K38:

pgtest=> create table dt(a timestamp);
CREATE TABLE
pgtest=> insert into dt(a) values('2099-01-01 01:23:45.678901');
INSERT 0 1
pgtest=> select * from dt;
             a              
----------------------------
 2099-01-01 01:23:45.678901
(1 row)


HTH,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list