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

Fix wrong time offset on DST. (Closes: #4615)

parent 2e18dc32
Branches
No related tags found
No related merge requests found
......@@ -645,10 +645,10 @@ class Client(object):
def format_timestamp(epoch=None, utc=True, utcoffset=None):
if utcoffset is None:
utcoffset = -(time.altzone if time.daylight else time.timezone)
if epoch is None:
epoch = time.time()
if utcoffset is None:
utcoffset = -(time.altzone if time.daylight and time.localtime(epoch).tm_isdst else time.timezone)
if utc:
epoch += utcoffset
us = int(epoch % 1 * 1000000 + 0.5)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment