1
0
Fork 0
forked from github/pelican

Correct bug in date format importation.

This commit is contained in:
FELD Boris 2011-01-24 23:50:29 +01:00
commit 1cc5017fb4

View file

@ -15,7 +15,11 @@ def wp2html(xml):
title = item.title.contents[0]
content = item.fetch('content:encoded')[0].contents[0]
filename = item.fetch('wp:post_name')[0].contents[0]
date = item.fetch('wp:post_date')[0].contents[0]
raw_date = item.fetch('wp:post_date')[0].contents[0]
date_object = time.strptime(raw_date, "%Y-%m-%d %H:%M:%S")
date = time.strftime("%Y-%m-%d %H:%M", date_object)
author = item.fetch('dc:creator')[0].contents[0].title()
yield (title, content, filename, date, author)