influxdata / influxdb-python

Python client for InfluxDB
MIT License
1.69k stars 521 forks source link

Time zone not working #867

Open d270624 opened 3 years ago

d270624 commented 3 years ago

SELECT * FROM "event" WHERE time > now() - 5d and Id = 'xxxx' tz('Asia/Shanghai') TZ ('Asia/Shanghai') time zone does not work

client.py #line 165 self._headers = { 'Content-Type': 'application/json', 'Accept': 'application/x-msgpack' }

I find that the problem is caused by setting Accept as application/x-msgpack, and it works normally when changing to application/json. I wonder if it is a bug?

sakethramanujam commented 3 years ago

could you please post the influx db, influx client versions and a sample data point that you're writing to the db so that it becomes easy to resolve the issue for the community?

d270624 commented 3 years ago

Influx version 1.7.4 use the cq table test of the _internal database, use SELECT FROM "cq" WHERE time > now() - 5m or SELECT FROM "cq" WHERE time > now() - 5m tz('Asia/Shanghai') test

sakethramanujam commented 3 years ago

The query seems to be running fine on my end.