Grafana time problem

Hello,

beacuse i’m stupid asf i would need some help with time series panel.

I have a python script that reads data from a energy consumption meter via ModBus TCP/IP, all the data is than stored in MySQL.

I live in Europe/Slovenia and my timezone is UTC+1 and beacuse as i said im stupid i cant configure grafana to show correct time.

Here is the screenshot of the problem.

Panel “TRENUTNA PORABA” shows the correct value (last value) as the last one is “88,91”.

Panel “MOČ” is time series panel and it shows correct time on axis but the actual value that is shown on graph is from 1 hour ago.

How do i fix this, what am i doing wrong?

In MySQL table field is "DATETIME"

In Python i read current date and time like this:
from datetime import datetime

date_of_reading = datetime.now()

Thanks

Welcome and no, you are not stupid.

  1. Either save your data as UTC when writing to the database. Or…

  2. QUERY the data using mysql function on the date field that converts it to UTC like

SELECT CONVERT_TZ(date_of_reading,'+1:00','+00:00')
From tesla

I’ve used this command and its working jesus, thanks !

1 Like