aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2012-04-15 13:02:22 +0200
committercedricbonhomme <devnull@localhost>2012-04-15 13:02:22 +0200
commit3cdf0d51d1ecd1ccd42c96ca15f8741d24613f9c (patch)
tree384b8ad81070e2da5c7c06fe03fc016d3c041e09
parentVersion 3.2. (diff)
downloadnewspipe-3cdf0d51d1ecd1ccd42c96ca15f8741d24613f9c.tar.gz
newspipe-3cdf0d51d1ecd1ccd42c96ca15f8741d24613f9c.tar.bz2
newspipe-3cdf0d51d1ecd1ccd42c96ca15f8741d24613f9c.zip
Bugfix: sqlite2mongo.py wasn't using datetime to store article's date in the data base.
-rw-r--r--sqlite2mongo.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sqlite2mongo.py b/sqlite2mongo.py
index 52cd36fe..633fb8f9 100644
--- a/sqlite2mongo.py
+++ b/sqlite2mongo.py
@@ -3,9 +3,12 @@
import hashlib
import sqlite3
-
import mongodb
+import utils
+
+from datetime import datetime
+
SQLITE_BASE = "./var/feed.db"
@@ -57,7 +60,7 @@ def sqlite2mongo():
article = {"article_id": article_id.encode('utf-8'), \
"type":1, \
- "article_date": article[0].encode('utf-8'), \
+ "article_date": utils.string_to_datetime(article[0]), \
"article_link": article[2].encode('utf-8'), \
"article_title": article[1].encode('utf-8'), \
"article_content": article[3].encode('utf-8'), \
bgstack15