::  Posts  ::  RSS  ::  ◂◂RSS  ::  Contact

Converting ISO 8061 datetimes to epoch timestamps

May 13th, 2011
tech, python  [html]
If you have something like:
2011-04-26T00:00:00Z-06
And you want to convert this into seconds since the epoch, apparently the incantation is:
int(time.mktime(dateutil.parser.parse(x).timetuple()))
This requires the dateutil module.

More Posts:


  ::  Posts  ::  RSS  ::  ◂◂RSS  ::  Contact