mblackstock / node-red-contrib-influxdb

Node-RED nodes to save and query data from an influxdb time series database
Other
64 stars 44 forks source link

tz('Europe/Berlin') not working #104

Closed solick closed 3 years ago

solick commented 3 years ago

Hi, i am playing around with node-red / InfluxDB and found the following strange behavior:

I have a test measurement, let's call it test-monitor.

Within there I have the follwowing fields: time, ip, pint, isOnline, stateHasChanged, timestamp.

When executing the following query direct on influxdb:

SELECT * FROM "test-monitor" tz('Europe/Berlin');

I receive the correct time +2 hours.

When I execute the exact same query via the influxdb in node, the timezone has not changed and shows the original UTC value.

any idea on this? I was assuming, that the node is passing the query 1:1 zu InfluxDB so there should be no issue with this.

mblackstock commented 3 years ago

Yes, this has been raised before. I don't have a good solution other than to take care of the timezone on the client side. The underlying library does not return timestamps that incorporate timezone information by default. See #98 and refs there, as well as https://github.com/influxdata/influxdb/issues/8460

eicheg commented 3 years ago

Ok, it's late, sorry. There are two workarounds: