Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Created February 7, 2013 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdamusic/4734302 to your computer and use it in GitHub Desktop.
Save lambdamusic/4734302 to your computer and use it in GitHub Desktop.
Django: Convert the time.struct_time object into a datetime.datetime object:
from time import mktime
from datetime import datetime
dt = datetime.fromtimestamp(mktime(item['updated_parsed']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment