summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorZhongyue Luo <lzyeval@gmail.com>2012-06-10 18:42:18 +0800
committerZhongyue Luo <lzyeval@gmail.com>2012-06-11 22:56:53 +0800
commitbe86feba38250988ca9d0c026e29708503f9e189 (patch)
treee5301ae12e7a8f09339a0f0422c6de098d55b33f /openstack
parent5fc561c95fd391339030809d9958a3ef45505742 (diff)
downloadoslo-be86feba38250988ca9d0c026e29708503f9e189.tar.gz
oslo-be86feba38250988ca9d0c026e29708503f9e189.tar.xz
oslo-be86feba38250988ca9d0c026e29708503f9e189.zip
Fix utcnow_ts to return UTC timestamp
Fixes bug #1011121 Use calendar.timegm instead of time.mktime Change-Id: Idb8d470f1ef90162641d21122699a026fa38faf1
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/timeutils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/openstack/common/timeutils.py b/openstack/common/timeutils.py
index a7b2ce3..5eeaf70 100644
--- a/openstack/common/timeutils.py
+++ b/openstack/common/timeutils.py
@@ -19,6 +19,7 @@
Time related utilities and helper functions.
"""
+import calendar
import datetime
import time
@@ -74,7 +75,7 @@ def is_older_than(before, seconds):
def utcnow_ts():
"""Timestamp version of our utcnow function."""
- return time.mktime(utcnow().timetuple())
+ return calendar.timegm(utcnow().timetuple())
def utcnow():