[Python-ideas] datetime: Support infinity

Thomas Güttler guettliml at thomas-guettler.de
Mon Jan 26 09:24:07 CET 2015


postgreSQL supports infinity for datetime:


infinity 	date, timestamp 	later than all other time stamps
-infinity 	date, timestamp 	earlier than all other time stamps

Mapping this to python is not possible at the moment.



PostgreSQL can store the representation of an “infinite” date, timestamp, or interval. Infinite dates are not available 
to Python, so these objects are mapped to date.max, datetime.max, interval.max. Unfortunately the mapping cannot be 
bidirectional so these dates will be stored back into the database with their values, such as 9999-12-31.

I don't know the internals of the datetime module. I guess it is not possible to support infinity.

What do you think?

   Thomas Güttler

More information about the Python-ideas mailing list