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


/ Published in: Django
Save to your folder(s)



Copy this code and paste it in your HTML
  1. from time import mktime
  2. from datetime import datetime
  3. dt = datetime.fromtimestamp(mktime(item['updated_parsed']))

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.