Skip to content

Instantly share code, notes, and snippets.

@enaeseth
Created April 13, 2011 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enaeseth/917100 to your computer and use it in GitHub Desktop.
Save enaeseth/917100 to your computer and use it in GitHub Desktop.
Minutes since the UNIX epoch
>>> from datetime import datetime
>>> int32_max = (2 ** 31) - 1
>>> # year 2038 problem:
... datetime.utcfromtimestamp(int32_max)
datetime.datetime(2038, 1, 19, 3, 14, 7)
>>> # but minute resolution gets us much further:
... datetime.utcfromtimestamp(int32_max * 60)
datetime.datetime(6053, 1, 23, 2, 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment