Skip to content

Instantly share code, notes, and snippets.

@hughsaunders
Created August 30, 2013 15:48
Show Gist options
  • Save hughsaunders/6391220 to your computer and use it in GitHub Desktop.
Save hughsaunders/6391220 to your computer and use it in GitHub Desktop.
>>> d=datetime.dateime(2010,10,10)
>>> time.mktime(d.utctimetuple()); calendar.timegm(d.utctimetuple())
1286668800.0
1286668800
>>> time.mktime(d.timetuple()); calendar.timegm(d.timetuple())
1286665200.0
1286668800
>>> d.timetuple()
time.struct_time(tm_year=2010, tm_mon=10, tm_mday=10, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=283, tm_isdst=-1)
>>> d.utctimetuple()
time.struct_time(tm_year=2010, tm_mon=10, tm_mday=10, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=6, tm_yday=283, tm_isdst=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment