Tag history t_stamp showing 4 hours in the future

Hello!

I am going through the tag histroy table and noticed that the t_stamp is showing 4 hours in the future. My gateway is seeing the correct EST timezone, as well as the project looking at the gateway timezone.

Gateway timezone:
image

Timezone within the project properties:

This is a expression that pulls the current DateTime:

Here is the query to pull the records, I am using the DATEADD feature recommended on the support page

SELECT [tagid]
      ,[intvalue]
      ,[floatvalue]
      ,[stringvalue]
      ,[datevalue]
      ,[dataintegrity]
      ,DATEADD(s,t_stamp/1000,'1970-01-01 00:00:00')
  FROM [fakedb].[db_owner].[sqlth_1_data]
  order by t_stamp desc

This is the date I get back. It is set to record the value every minute. at the time of this post it is 10:51 AM EST
image

Let me know if I am missing anything, thank you!

Well, that would be the correct UTC time. I'd blame your DB. SQL Server, I'd guess. It doesn't do time zones in a JDBC-friendly way. (And not at all by default--need to use DATETIME2.) One of the reasons I despise it.

2 Likes

Yes it must be related to the database. I looked within the Windows OS date and time settings and it is using the UTC-05:00 Indiana (EST) which is what it should be set on. I may reach out to support to see if they have any additional details.

Thank you!

I believe I have found a temporary fix. Since it is displaying the time 4 hours in the future, I accounted for that within my SQL query.

DATEADD(s,t_stamp/1000,'1970-01-01 00:00:00') - '04:00'

By adding in the - '04:00' returns the correct datetime. I still put a ticket in with support to see why this happened and if it will try to revert to EST in the future.