Skip to content

Instantly share code, notes, and snippets.

@brendanberg
Last active August 29, 2015 14:06
Show Gist options
  • Save brendanberg/633b62c49bb20219ca1d to your computer and use it in GitHub Desktop.
Save brendanberg/633b62c49bb20219ca1d to your computer and use it in GitHub Desktop.
Python's dateutil module, everybody!
>>> from dateutil import parser
>>> parser.parse('0001-01-01')
datetime.datetime(2001, 1, 1, 0, 0)
>>> parser.parse('0010-01-01')
datetime.datetime(2001, 10, 1, 0, 0)
>>> parser.parse('0015-01-01')
datetime.datetime(2001, 1, 15, 0, 0)
>>> parser.parse('0050-01-01')
datetime.datetime(2050, 1, 1, 0, 0)
>>> parser.parse('0070-01-01')
datetime.datetime(1970, 1, 1, 0, 0)
>>> parser.parse('0080-01-01')
datetime.datetime(1980, 1, 1, 0, 0)
>>> parser.parse('0090-01-01')
datetime.datetime(1990, 1, 1, 0, 0)
>>> parser.parse('0099-01-01')
datetime.datetime(1999, 1, 1, 0, 0)
>>> parser.parse('0100-01-01')
datetime.datetime(100, 1, 1, 0, 0)
>>> parser.parse('1000-01-01')
datetime.datetime(1000, 1, 1, 0, 0)
@brendanberg
Copy link
Author

Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment