Converting ISO 8061 datetimes to epoch timestamps

May 13th, 2011
python, tech
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.

Comment via: substack

Recent posts on blogs I like:

Variable fonts aren't universally supported

I make a lot of webpages. I also use Lockdown Mode on iOS and MacOS for a bit of extra security. Sometimes I realize that I forgot to test on Safari and it looks like crap, or I test and don’t notice that there’s been a problem for months (as was the case…

via Home June 27, 2026

Ozy in Asterisk on coping with AI doom

I wrote an article for Asterisk Magazine about people who believe in AI superintelligence soon, and who are chill about it.

via Thing of Things June 24, 2026

Fiddle Practice

For a while I wasn't learning how to play violin very well because whenever it was time to practice I didn't want to. I didn't really like practicing, because (1) it's boring, (2) I have better things to do, and (3) actually I guess there …

via Anna Wise's Blog Posts May 3, 2026

more     (via openring)