Timezone Discrepancy Issue in Grafana and SQL Server on Windows Server

Hello!!

I’m using Grafana 10 with SQL Server 2022, all on Windows Server 2022, and I’m experiencing a timezone issue. I’ve adjusted the time on the database, Grafana, the browser, the instance, and other components. However, when I generate a query in a panel within Grafana, I’m getting a three-hour time difference ahead. What could be the cause of this problem?

I’m encountering this error with the following script:
select HEA_RES_ID
,HEA_TIME_CLOSING
,HEA_LATITUDE as lat
,HEA_LONGITUDE as lng
,$__timeEpoch(HEA_TIME_CLOSING)
,DATEDIFF(second, ‘2023-01-01’, HEA_TIME_CLOSING) as g
,$__unixEpochTo() as u
from HEA_ANSWER
where $__timeFilter(HEA_TIME_CLOSING)

I’ve found that if I adjust the script to:
select * from (
select HEA_RES_ID
,DATEADD(hh,3,HEA_TIME_CLOSING) as HEA_TIME_CLOSING
,HEA_LATITUDE as lat
,HEA_LONGITUDE as lng
from HEA_ANSWER
) as t
where $__timeFilter(t.HEA_TIME_CLOSING)

It works, but it’s not ideal because I’m adding 3 hours, which is not my local time.

Welcome @ehadev

Is your HEA_TIME_CLOSING UTC?

Hello!

Yes!

1 Like

What do you have configured in your browser?

image

In my browser, I’ve tried changing my timezone to UTC-7, UTC-6, and UTC-5.
In Grafana, I’ve also made the same adjustments, but the time difference still persists.