summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Yves Chibon <pingou@pingoured.fr>2012-05-23 11:48:14 +0200
committerPierre-Yves Chibon <pingou@pingoured.fr>2012-05-23 11:48:14 +0200
commitd96fe037291f81fddce35727a96fca6916362d26 (patch)
treedcea255d778280624b71f87c13e2c8234499fa8d
parentb99eda48f955983a14aa89fdc5ed7ec656e84c36 (diff)
downloadkittystore-d96fe037291f81fddce35727a96fca6916362d26.tar.gz
kittystore-d96fe037291f81fddce35727a96fca6916362d26.tar.xz
kittystore-d96fe037291f81fddce35727a96fca6916362d26.zip
Convert time to UTC
-rwxr-xr-xto_mongo.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/to_mongo.py b/to_mongo.py
index a1e1df3..379dfaf 100755
--- a/to_mongo.py
+++ b/to_mongo.py
@@ -22,9 +22,9 @@ TOTALCNT = 0
def convert_date(date_string):
""" Convert the string of the date to a datetime object. """
- date_string = date_string.strip()
+ date_string = date_string.split('(')[0].strip()
dt = parse(date_string)
- return dt
+ return dt.astimezone(tz.tzutc())
def to_mongo(mbfile, database):