Note that the first is positive since the difference is to get Epoch Time, and the BETWEEN statement is negative since the function _timeFrom() has different format.Convert timezones and find the best time for your meeting in Hi, we have a timestamp on a MSSQL database which is not in UTC, and as we don’t have access to correct this issue, we found a workaround is to make a SQL that can return the dates and ranges with the correct time to be displayed in Grafana.įirst, we changed _timeEpoch() into DATEDIFF and DATEADD. So the question is, what is the benefit of storing timestamps in a non-standard way? If it stored transactions in the different countries in different timezones then disaster would very soon ensue.Īll serious databases around the world store timestamps in UTC, so to allow grafana to be able to use local timezone timestamps you are asking for additional complexity to be added.
Your bank, for example, has to record every transaction around the world in a way that is consistent. Even worse suppose your company moved to a different zone, what would you do then? You may say you don’t care because those issues don’t apply to you, but they do apply to many many organisations. So if you want to save the time in local time it takes the computer more work as it has to convert the UTC time to local.Īlso consider what would happen if your UK branch wanted to add data into the db? They would have to convert it to your timezone. If you change the time zone on your PC it displays a different local time, but when changing the zone it does not change the actual time clock in the PC, which is in UTC, it just changes the way the time is displayed.
Why? What is the benefit? Remember that computers work in UTC, not local time. I should be able to change which standard GMT I wanted to use in Grafana