server/sqlutils.py
changeset 11034 75d752e6daf7
parent 11032 38afb7e23c6c
child 11035 0fb100e8385b
--- a/server/sqlutils.py	Fri Dec 18 09:23:23 2015 +0100
+++ b/server/sqlutils.py	Tue Dec 22 15:35:10 2015 +0100
@@ -30,6 +30,8 @@
 from six import string_types, text_type
 from six.moves import filter
 
+from pytz import utc
+
 from logilab import database as db, common as lgc
 from logilab.common.shellutils import ProgressBar, DummyProgressBar
 from logilab.common.deprecation import deprecated
@@ -503,6 +505,8 @@
                                 row[cellindex] = strptime(value, '%Y-%m-%d %H:%M:%S')
                             except Exception:
                                 row[cellindex] = strptime(value, '%Y-%m-%d')
+                            if vtype == 'TZDatetime':
+                                row[cellindex] = row[cellindex].replace(tzinfo=utc)
                         if vtype == 'Time' and isinstance(value, text_type):
                             found_date = True
                             try: