What is the oldest time that can be represented in Python?
In python, the datetime object exports the following constants
datetime.MINYEAR
The smallest year number allowed in a date or datetime object. MINYEAR is 1.
datetime.MAXYEAR
The largest year number allowed in a date or datetime object. MAXYEAR is 9999.
http://docs.python.org/library/datetime.html
If using the datetime module, date, time, and datetime objects all have a min
and max
attribute.
>>> from datetime import date, time, datetime
>>> date.min
datetime.date(1, 1, 1)
>>> date.max
datetime.date(9999, 12, 31)
>>> time.min
datetime.time(0, 0)
>>> time.max
datetime.time(23, 59, 59, 999999)
>>> datetime.min
datetime.datetime(1, 1, 1, 0, 0)
>>> datetime.max
datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)