-
Notifications
You must be signed in to change notification settings - Fork 185
Timezone location ignored #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @Siirko, thanks for using our client. How looks like the raw output of your query in InfluxDB UI? Regards |
With a simple request,
But using InfluxQL with
The time is correctly formatted |
from influxdb_client.client.util import date_utils
from influxdb_client.client.util.date_utils import DateHelper
import dateutil.parser
from dateutil import tz
def parse_date(date_string: str):
return dateutil.parser.parse(date_string).astimezone(tzlocal())
date_utils.date_helper = DateHelper()
date_utils.date_helper.parse_date = parse_date This helped me to have correct result when using query() function, but not query_csv() |
The |
This is a "tricks", if I understand correctly what does
in a flux query, I shouldn't be doing like I mentionned in previous answer and get correct date format |
Hi @Siirko, sorry for the late. Setting the If you want to shift response from InfluxDB you have to use |
Specifications
Code sample to reproduce problem
Expected behavior
_time should been "+0200" timezone and not in "Z"
Actual behavior
['', 'result', 'table', '_time', 'deviceName', 'humidity', 'temperature']
['', '_result', '0', '2023-07-10T08:04:15.983755716Z', 'RHF1S001-008', '61.3828125', '27.49101440429687']
['', '_result', '1', '2023-07-10T08:03:52.513992459Z', 'RHF1S001-009', '61.87109375', '27.437388916015628']
FluxTable() columns: 6, records: 1
{'result': '_result', 'table': 0, '_time': datetime.datetime(2023, 7, 10, 8, 4, 15, 983755, tzinfo=tzutc()), 'deviceName': 'RHF1S001-008', 'humidity': 61.3828125, 'temperature': 27.49101440429687}
FluxTable() columns: 6, records: 1
{'result': '_result', 'table': 1, '_time': datetime.datetime(2023, 7, 10, 8, 3, 52, 513992, tzinfo=tzutc()), 'deviceName': 'RHF1S001-009', 'humidity': 61.87109375, 'temperature': 27.437388916015628}
Additional info
I maybe did something wrong ?
The text was updated successfully, but these errors were encountered: