Skip to content

Commit ca10f5e

Browse files
committed
line protocol: fix timestamp UTC conversion
1 parent 99cc8ca commit ca10f5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

influxdb/line_protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4+
from calendar import timegm
45
from copy import copy
56
from datetime import datetime
6-
from time import mktime
77

88
from dateutil.parser import parse
99
from pytz import utc
@@ -20,7 +20,7 @@ def _convert_timestamp(timestamp):
2020
timestamp = timestamp.astimezone(utc)
2121
timestamp.replace(tzinfo=None)
2222
return (
23-
mktime(timestamp.timetuple()) * 1e9 +
23+
timegm(timestamp.timetuple()) * 1e9 +
2424
timestamp.microsecond * 1e3
2525
)
2626
raise ValueError(timestamp)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy