Configuring timezones in InfluxDB
I am experimenting with InfluxDB for timeseries datastore solution, and having an issue with using InfluxDB with different timezones.
Essentially, I am writing all data points into InfluxDB with UTC timestamps, but in the queries it would be very convenient (especially for testing) to specify timestamp ranges using the local timezone of the server.
Does anybody know how to achieve this in InfluxDB?
You can compute timezone before or after query to Influxdb by your side, another solutions I don’t see. And btw, use everywhere utc timezone it’s really good decision, and compute to time zone do you need only in last point.
I living in the other end of the pacific ocean And I using python to put data into influxdb. Once,I was so desperate for the answer of your question.I gave up searching cuz the official did not provide the way to achieve this.
So when I putting data into influxdb,I will decrease my timestamp by 28800. 🙂
and when I need querying, I will do some compensation work like:
def fab_querytime(intime): if isinstance(intime,basestring) and len(intime) == 12: # my query time args like 201804061200 _t = arrow.get(intime,'YYYYMMDDHHmm') _t = _t.replace(hours=-8) return fab_querytime(_t) if isinstance(intime,arrow.arrow.Arrow): _str = intime.format('YYYY-MM-DDTHH:mm:ss') + '.000Z' return str(_str)