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.

Recent posts on blogs I like:

Effective Altruism: Maximizing, Welfarist Consequentialism

Effective altruism is a form of maximizing, welfarist consequentialism.

via Thing of Things February 10, 2025

The best children’s books are easily found used online

Finding your next favorite on Ebay The post The best children’s books are easily found used online appeared first on Otherwise.

via Otherwise February 2, 2025

2024-25 New Year review

This is an annual post reviewing the last year and setting intentions for next year. I look over different life areas (work, health, parenting, effectiveness, travel, etc) and analyze my life tracking data. Overall this was a pretty good year. Highlights …

via Victoria Krakovna January 15, 2025

more     (via openring)