Posted By

magicrebirth on 07/20/11


Tagged

python DateTime


Versions (?)

Convert the time.struct_time object into a datetime.datetime object:


 / Published in: Django
 

URL: http://stackoverflow.com/questions/6287268/populating-a-django-datetimefield-with-feedparser

  1. from time import mktime
  2. from datetime import datetime
  3. dt = datetime.fromtimestamp(mktime(item['updated_parsed']))

Report this snippet  

You need to login to post a comment.