Skip to main content

Understanding Tag Historian Timestamps

Comments

2 comments

  • eguadalupe

    For SQL Server, we can expand the example to retain milliseconds:

    DATEADD(ms, t_stamp % 1000, DATEADD(s, t_stamp / 1000, '1970-01-01'))

    0
  • Tyler Bennett

    For PostgreSQL...

    Usage: SELECT to_timestamp(t_stamp/1000) AS ts, * FROM sqlt_data_...

    It may also be useful to note that "standard" Unix Epoch time is the number of seconds since January 1, 1970 00:00:00 UTC. The Ignition variant uses milliseconds instead of seconds and that is why all the examples start by dividing the returned t_stamp value by 1000. 

    Reference:  https://forum.inductiveautomation.com/t/understanding-tag-historian-timestamps-in-postgresql/63663 

    0

Please sign in to leave a comment.

This article has 2 comments.