Is it possible that historical data is recorded in database tables using GMT Timezone ? Can it be changed ?
I’m asking because when I launch queries against Ignition historical tables, the data timestamp returned is off by 5 hours. (My server timezone is set to GMT -5)
When using Easy Chart or other components, data is shown using correct timestamp.
It’s always stored as UTC. So, you can adjust from there. In Ignition, dates are also stored as utc, but when displayed, the system takes the local time zone into account and adjusts it.
Which database are you using, maybe I can provide further guidance.
Thanks, I’m using MSSQL
No exactly pretty but I’m pulling data from tables using
DATEADD(HOUR, -5, DATEADD(s,tag_values.t_stamp/1000,’‘1970-01-01 00:00:00’’))
At least, it works
Yes, you’re on the right track, but the problem is that due to daylight savings time, your offset can be different at different times of the year.
Check out the advice in this exchange. Substitute [tt]DATEADD(s,tag_values.t_stamp/1000,’‘1970-01-01 00:00:00’’)[/tt] anywhere they talk about “utc timestamp”.