X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Futil%2Fsfatime.py;h=d14f44b0a52646077e81bfd6b191f9ca3bee8f90;hb=d748c93a11a23b22d9e310db3c58c2bfb18b38fb;hp=992785e1707d2a000f95b6b1d8ae1dc6d8268e6c;hpb=3ae1605fb3d0594364b684b595eb21a81717d9ad;p=sfa.git diff --git a/sfa/util/sfatime.py b/sfa/util/sfatime.py index 992785e1..d14f44b0 100644 --- a/sfa/util/sfatime.py +++ b/sfa/util/sfatime.py @@ -27,7 +27,7 @@ import time from sfa.util.sfalogging import logger -DATEFORMAT = "%Y-%m-%dT%H:%M:%SZ" +SFATIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ" def utcparse(input): """ Translate a string into a time using dateutil.parser.parse but make sure it's in UTC time and strip @@ -57,7 +57,7 @@ For safety this can also handle inputs that are either timestamps, or datetimes logger.error("Unexpected type in utcparse [%s]"%type(input)) def datetime_to_string(input): - return datetime.datetime.strftime(input, DATEFORMAT) + return datetime.datetime.strftime(input, SFATIME_FORMAT) def datetime_to_utc(input): return time.gmtime(datetime_to_epoch(input))