datetime strftime methods require year >= 1900

John Hunter jdhunter at ace.bsd.uchicago.edu
Wed Sep 29 08:47:04 EDT 2004


>>> from datetime import date
>>> dt = date(1005,1,1)
>>> print dt.strftime('%Y')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: year=1005 is before 1900; the datetime strftime() methods require year >= 1900

Does anyone know of a datetime string formatter that can handles
strftime format strings over the full range that datetime objects
support?

Thanks,
John Hunter



More information about the Python-list mailing list