summaryrefslogtreecommitdiffstats
path: root/pykolab/xml/utils.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-19 23:02:17 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-19 23:02:17 -0400
commit50ecd9edf92d3d50492f23408e009c900a63d882 (patch)
treef7e91a3d25dcbef75fa4400e4c0b994fbeea04ca /pykolab/xml/utils.py
parent57a48ed5e5fed38b4bbbb088fc9425a4b407c0b0 (diff)
downloadpykolab-50ecd9edf92d3d50492f23408e009c900a63d882.tar.gz
Translate UTC and GMT timezones into the according isUTC flag
Diffstat (limited to 'pykolab/xml/utils.py')
-rw-r--r--pykolab/xml/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/xml/utils.py b/pykolab/xml/utils.py
index 2fddb24..bcaa480 100644
--- a/pykolab/xml/utils.py
+++ b/pykolab/xml/utils.py
@@ -92,6 +92,9 @@ def to_cdatetime(_datetime, with_timezone=True):
_cdatetime = kolabformat.cDateTime(year, month, day)
if with_timezone and hasattr(_datetime, "tzinfo"):
- _cdatetime.setTimezone(_datetime.tzinfo.__str__())
+ if _datetime.tzinfo.__str__() in ['UTC','GMT']:
+ _cdatetime.setUTC(True)
+ else:
+ _cdatetime.setTimezone(_datetime.tzinfo.__str__())
return _cdatetime