From 1cc5017fb49deecfc0edcd321a3ff776a9a90ea0 Mon Sep 17 00:00:00 2001 From: FELD Boris Date: Mon, 24 Jan 2011 23:50:29 +0100 Subject: [PATCH] Correct bug in date format importation. --- tools/wp2pelican.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/wp2pelican.py b/tools/wp2pelican.py index 9a52a8f8..27678126 100755 --- a/tools/wp2pelican.py +++ b/tools/wp2pelican.py @@ -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)