New user's issue with time settings

I have just loaded Grafana on PC and via Localhost:3000 connected to a database on a locally networked Raspberry Pi. The RPi logs temperatures to a MariaDB (MySQL) database which is being queried.

The issue I have is it looks like the data is out of sync, could be by 8 hours and my timezone is UTC +8 so that maybe the issue. Also I have selected 12 hrs but only see about 4 hrs, maybe it’s 12 - 8 = 4.
I have attached screenshot of Grafana chart.

I’m guessing there is an issue with global time settings. My database time stamps are local time. I have attached screenshot showing format.

Any hints on how I might resolve this would be appreciated.

Hi @eyersg

I would explore some topics in this forum on this very matter. Here is a useful one:

In short, UTC issues can be tricky, but you might want to switch your DB and system to UTC and set the local timezone in your grafana preferences :+1:

Thanks for the guidance.

It appears MYSQL has some processing between database and applications to deal with time zones when using the timestamp default field. So while it works with PHP and Python it’s not so seamless with Grafana. In a trial I inserted another column into the db and used a query UPDATE templog SET udtg = UNIX_TIMESTAMP(dtg) to populate the new column with the integer value for date and time. Using the new column for the time input the Grafana output was as expected.

1 Like