# Tag history t\_stamp showing 4 hours in the future

**URL:** <https://forum.inductiveautomation.com/t/tag-history-t-stamp-showing-4-hours-in-the-future/65405>\
**Category:** Ignition\
**Tags:** ignition81, database\
**Created:** [October 19, 2022, 2:53pm UTC](https://forum.inductiveautomation.com/t/tag-history-t-stamp-showing-4-hours-in-the-future/65405 "2022-10-19T14:53:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raymond\_Sipes](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@Raymond\_Sipes](https://forum.inductiveautomation.com/u/Raymond_Sipes)\
**Post date:** [October 19, 2022, 2:53pm UTC](https://forum.inductiveautomation.com/t/tag-history-t-stamp-showing-4-hours-in-the-future/65405/1 "2022-10-19T14:53:43Z")

</div>

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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/8/f86aa80e97ad4bcaea671837cc6ebd686305e333.png)

Timezone within the project properties:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3f7c531d6147f0a4c0a2f3fb9a3ea767d544abb1.png)

This is a expression that pulls the current DateTime:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d92305df8eab3de22e9cb5ecea5844e64421f6d3.png)

Here is the query to pull the records, I am using the DATEADD feature recommended on the [support page](https://support.inductiveautomation.com/hc/en-us/articles/360047136252-Understanding-Tag-Historian-Timestamps)

```auto
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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/4/34379a81881f7885085ed291710bfa9509cb12cd.png)

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 19, 2022, 3:32pm UTC](https://forum.inductiveautomation.com/t/tag-history-t-stamp-showing-4-hours-in-the-future/65405/2 "2022-10-19T15:32:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Raymond\_Sipes](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@Raymond\_Sipes](https://forum.inductiveautomation.com/u/Raymond_Sipes)\
**Post date:** [October 19, 2022, 3:47pm UTC](https://forum.inductiveautomation.com/t/tag-history-t-stamp-showing-4-hours-in-the-future/65405/3 "2022-10-19T15:47:10Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Raymond\_Sipes](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@Raymond\_Sipes](https://forum.inductiveautomation.com/u/Raymond_Sipes)\
**Post date:** [October 19, 2022, 8:14pm UTC](https://forum.inductiveautomation.com/t/tag-history-t-stamp-showing-4-hours-in-the-future/65405/4 "2022-10-19T20:14:48Z")

</div>

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.

```auto
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.
