Created
February 7, 2013 21:25
-
-
Save lambdamusic/4734302 to your computer and use it in GitHub Desktop.
Django: Convert the time.struct_time object into a datetime.datetime object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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