diff options
| author | Zhongyue Luo <lzyeval@gmail.com> | 2012-06-10 18:42:18 +0800 |
|---|---|---|
| committer | Zhongyue Luo <lzyeval@gmail.com> | 2012-06-11 22:56:53 +0800 |
| commit | be86feba38250988ca9d0c026e29708503f9e189 (patch) | |
| tree | e5301ae12e7a8f09339a0f0422c6de098d55b33f /openstack | |
| parent | 5fc561c95fd391339030809d9958a3ef45505742 (diff) | |
| download | oslo-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.py | 3 |
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(): |
