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

Parse Facebook feed datetime in python?

$
0
0
  1. I am reading a Facebook updates feed using the python library 'feedparser'.
  2. I loop through the collection of entries in my Django templates, and display the results.
  3. The updated field is returned in a big long string, of some format I am unfamiliar with.

    Tue, 01 Dec 2009 23:55:52 +0000

How can I...

A) Use a Django filter to clean the date time in the for loop on the template.

...or...

B) Parse the date and format the updated date in the view, esentially cleaning the date in the collection of entries before it is iterated over in the view.

NOTE: I have tried both approaches. Django's date filter does't recognize it, and the iso8601 library I tried to parse the string didn't either.

Anybody have any experience with this? Thanks for your help!

UPDATE:

Using the updated_parsed value from feedparser in a Django template didn't work so well. But a Django snippet of a filter for this very thing already exists!**

Django Snippet:http://www.djangosnippets.org/snippets/1595/


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images