Skip to content

Instantly share code, notes, and snippets.

View itsMagondu's full-sized avatar
🎯
Focusing

Samuel Magondu Njenga itsMagondu

🎯
Focusing
View GitHub Profile
@squioc
squioc / gist:3078803
Created July 9, 2012 20:49
conversion between iso8601 date format and unix epoch datetime
from datetime import datetime
import calendar
def epoch_to_iso8601(timestamp):
"""
epoch_to_iso8601 - convert the unix epoch time into a iso8601 formatted date
>>> epoch_to_iso8601(1341866722)
'2012-07-09T22:45:22'
"""