File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
influxdb_client/client/util Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 88
99
1010class DateHelper :
11- """DateHelper to groups different implementations of date operations."""
11+ """
12+ DateHelper to groups different implementations of date operations.
13+
14+ If you would like to serialize the query results to custom timezone, you can use following code:
15+
16+ .. code-block:: python
17+
18+ from influxdb_client.client.util import date_utils
19+ from influxdb_client.client.util.date_utils import DateHelper
20+ import dateutil.parser
21+ from dateutil import tz
22+
23+ def parse_date(date_string: str):
24+ return dateutil.parser.parse(date_string).astimezone(tz.gettz('ETC/GMT+2'))
25+
26+ date_utils.date_helper = DateHelper()
27+ date_utils.date_helper.parse_date = parse_date
28+ """
1229
1330 def __init__ (self , timezone : datetime .tzinfo = tz .utc ) -> None :
1431 """
You can’t perform that action at this time.
0 commit comments