From bf40e7d53070f6d26e1e52a5b1ed82777290661f Mon Sep 17 00:00:00 2001 From: Sinisa Veseli <sveseli@aps.anl.gov> Date: Fri, 29 Jan 2016 16:58:05 +0000 Subject: [PATCH] round conversion to local time --- src/python/dm/common/utility/timeUtility.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/dm/common/utility/timeUtility.py b/src/python/dm/common/utility/timeUtility.py index cfcfbceb..6d60f76a 100755 --- a/src/python/dm/common/utility/timeUtility.py +++ b/src/python/dm/common/utility/timeUtility.py @@ -45,6 +45,10 @@ class TimeUtility: def utcToLocalTime(cls, utc): if cls.UTC_MINUS_LOCAL_TIME is None: cls.UTC_MINUS_LOCAL_TIME = (datetime.datetime.utcnow()-datetime.datetime.now()).total_seconds() + if cls.UTC_MINUS_LOCAL_TIME > 0: + cls.UTC_MINUS_LOCAL_TIME = int(cls.UTC_MINUS_LOCAL_TIME+0.5) + else: + cls.UTC_MINUS_LOCAL_TIME = int(cls.UTC_MINUS_LOCAL_TIME-0.5) localTime = utc - cls.UTC_MINUS_LOCAL_TIME return localTime -- GitLab