Timestamp gap between system time and InfluxDB time

I’m using InfluxDB 1.4 on Raspberry Jessy. I spotted a difference of two hours between the OS time and the InfluxDB time. How can I adjust it?

$ date
Fr 30. Mär 11:22:30 CEST 2018
...........
> insert Sys_CPU_Load value=1.0
> select * from Sys_CPU_Load
name: Sys_CPU_Load
time                           value
----                           -----
2018-03-30T09:22:35.947728959Z 1

Update:
OK guys, I found the reason. InfluxDB stores UTC timestamps only and I’m 2 hours away from UTC.
I found as well, that one can adjust the time output in a Select statement by adding a TZ() argument.
Question: is it meanwhile possible to set a global TZ as preference for InfluxDB?

You’re correct that InfluxDB stores data using UTC timestamps.

There is no way to set a time zone as a preference for InfluxDB.

If you’re writing an application with InfluxDB, you could add this kind of functionality to your application; you might travel, and want to access your application from a different timezone, or you might have different users who are accessing the application from different timezones.

Chronograf, for example, will offset the UTC data stored in InfluxDB to your local time.

1 Like

Many thanks for a very helpful answer.

1 Like