Timezone problem, php and grafana add UTC timezone, value wrong

Hello

I use php to write data in my mysql MariaDB

Now i have a problem with the time graphics in grafana.
In my php script i set the time
date_default_timezone_set('Europe/Berlin');

so thats UTC +02:00
okay. that works great. in my databse is the correct time.

But in grafana it will add 2 hours more.
for example: in my DB is 14:00 → grafana shows 16:00

now i tried to set the default timezone in grafana. i delete brwoser and add UTC.
Nothing work.

Any solution? i think php add 2 hours for the correct time and grafana add also 2 ours…
it will be better, if grafana takes the time from the db without "re-"config any timezones…

Thank you for your help

i set default timezone to UTC. So i think grafan not add or substract any value.
don’t know if that’s the correct way.

BUT it NOT work.
Because now the absolute time is wrong.
I need to set the UTC to +02:00
But the data from the database should not b e changed!

any solution?

I’m happy for any tipps
best regards

What timezone is you datetime column in MariaDb ?

Not UTC
It is +02:00
I found the Answer in another Post.
Grafana needs UTC 00 value from DB
So i use a quer which covert my time to UTC 00

1 Like