Quantcast
Channel: Parse Facebook feed datetime in python? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Ryan Montgomery for Parse Facebook feed datetime in python?

$
0
0

This worked but wasn't what my final solution ended up becoming.

This solution iterates over the feed entries collection I get back from Facebook. I then parse the datetime and set the updated property to that new datetime. (Also, ignoring the +0000)

for entry in feed.entries:        entry.updated = datetime.strptime(entry.updated, "%a, %d %b %Y %H:%M:%S +0000")

The entries collection is returned to the template which I can now use the Django 'date' filter to format the date.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>