Delay on time with my server

Hello,

My issue is that the graph show delay`s for two hours, i put in the timerange last 6 hours and it show me the time with delay respect to the current time

Is the time shown at the right hand end of the time scale the correct current time?
If yes then almost certainly it is because the timestamps in the database are in local time instead of UTC

yes, but i dont know fix that in the server, currently i put in time range from:now-6h to now+2h, while i find a solution

Sorry, I am still not clear. If you use something like ‘now-6h to now’ for the range is the time on the axis correct? Don’t worry about the data for the moment, just the time at the right hand end of the axis, does it show the current time?

No, look that, in time range if i put now-6h to now, the time on the axis show me 15:20 more or less, but if you look my windows bar the time is 17:20

for this reason i put now-6h to now+2h because i got delay in the server i belive

sorry for my english

What Operating System is the machine running the browser using and what timezone is it set to?
What Operating System is the machine running the grafana server using and what timezone is it set to?
In the Dashboard Settings (the cog in the dashboard top panel) what is the Timezone set to?

OS in the machine Windows 10, google chrome and timezone UTC +1
OS in the grafana server debian, and timezone EUROPE/MADRID LMT its the same UTC+1
in the Dashboard Settings in all. UTC

That is saying that you want grafana to show time in UTC, so the first thing to do is change that, probably to Default, which should be to use the local machine’s system timezone. See what effect that has.

I tried but nothing change

What happens if you select Local Browser Time?
If switching between Local Browser Time and UTC makes no difference to the times shown along the axis can you copy/paste what you see when you go to this url in the browser please. http://browserspy.dk/date.php

look that

and when if my graph is on utc

and when change a local browser


my data change

You said you were on UTC+1, but actually you are on UTC+2, which explains some of the problem. Well we are making progress, it is now showing the correct local time on the x axis. The fact that data is being recorded in the database with a timestamp in the future means that the timestamps in the database are being recorded with a local time instead of UTC, which grafana expects. So for example the samples showing on the first chart at 12:30 UTC should have a timestamp of 10:30 UTC. So now you have to look at the code writing the data to the database and make sure they are given the correct timestamp.

OK i´ll to see, thanks for you help and support, when i can see,
I will write again

Hello again, To solve the problem, I had to modify the data that came from the server, since they are in GMT + 2. the code is dateadd(hour,-datediff(hour,GETUTCDATE(), getdate()),“FechaHora”) as time in the select request and the clause where “FechaHora” BETWEEN dateadd(hour,datediff(hour,GETUTCDATE(), getdate()),__timeFrom()) AND dateadd(hour,datediff(hour,GETUTCDATE(), getdate()),__timeTo())

thanks for you support

Have you considered what will be displayed when you are in the overlap period at the DST changeover? You will have two sets of data overlaid in the database, with the same local timestamps. That is why data should always be stored in the database in UTC and converted when necessary on extraction.

yes offcourse this gonna work