Skip to content
Snippets Groups Projects
Commit 99566a15 authored by Pavel Kácha's avatar Pavel Kácha
Browse files

Fix unix timestamp conversion - we always work with UTC, not localtime

parent cbc32f59
No related branches found
No related tags found
1 merge request!1CI/CD
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
# Copyright (c) since 2016, CESNET, z. s. p. o. # Copyright (c) since 2016, CESNET, z. s. p. o.
# Use of this source is governed by an ISC license, see LICENSE file. # Use of this source is governed by an ISC license, see LICENSE file.
__version__ = '0.1.12' __version__ = '0.1.13'
__author__ = 'Pavel Kácha <pavel.kacha@cesnet.cz>' __author__ = 'Pavel Kácha <pavel.kacha@cesnet.cz>'
...@@ -58,7 +58,7 @@ def Timestamp(t): ...@@ -58,7 +58,7 @@ def Timestamp(t):
return t return t
try: try:
# Try numeric type # Try numeric type
return datetime.datetime.fromtimestamp(float(t)) return datetime.datetime.utcfromtimestamp(float(t))
except (TypeError, ValueError): except (TypeError, ValueError):
pass pass
# Try RFC3339 string # Try RFC3339 string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment