0

I set the time as utc+3 (europe/istanbul) in the database. The data I get from the device looks correct in influxdb, but when I pull data from influxdb to html, it shows as UTC without the time set. I pull the queries like this. When I add the TZ(Europe/Istanbul) method to the end of the query, I get an error.I need the What should i do ?

temp = client.query("SELECT * From device_frmpayload_data_Temp WHERE time > now() - 7d ORDER BY time DESC")
hum = client.query("SELECT * From device_frmpayload_data_Hum WHERE time > now() - 7d ORDER BY time DESC")
air = client.query("SELECT * From device_frmpayload_data_Air WHERE time > now() - 7d ORDER BY time DESC")

In my settings.py also i set (Europe/Istanbul).

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
Doğukan CEBECİ
  • 300
  • 1
  • 3
  • 13
  • Did you try `SELECT * FROM device_frmpayload_data_Air WHERE time > now() - 7d ORDER BY time DESC tz('Asia/Istanbul')` - see doc https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#the-time-zone-clause – Jan Garaj Sep 16 '21 at 10:25
  • @janGaraj yeah i tried but its same. Device time don't come with query. now = timezone.now() is works with stftime(%h %m ...) but its just write computer time not device's. – Doğukan CEBECİ Sep 30 '21 at 21:11

0 Answers0