# Historian Timestamp Interpretation

**URL:** <https://forum.inductiveautomation.com/t/historian-timestamp-interpretation/6946>\
**Category:** Ignition\
**Created:** [July 29, 2013, 6:57pm UTC](https://forum.inductiveautomation.com/t/historian-timestamp-interpretation/6946 "2013-07-29T18:57:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apimente](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/apimente/32/4030_2.png) [@apimente](https://forum.inductiveautomation.com/u/apimente)\
**Post date:** [July 29, 2013, 6:57pm UTC](https://forum.inductiveautomation.com/t/historian-timestamp-interpretation/6946/1 "2013-07-29T18:57:36Z")

</div>

Dear Friends,

I’d would like to know how can i interpret the timestamp value in the history tables. Ignition write a raw value and i want to convert this number into a human legible data and time value.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![techerdone](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@techerdone](https://forum.inductiveautomation.com/u/techerdone)\
**Post date:** [July 29, 2013, 9:12pm UTC](https://forum.inductiveautomation.com/t/historian-timestamp-interpretation/6946/2 "2013-07-29T21:12:09Z")

</div>

from\_unixtime(t\_stamp/1000) for MySQL.

What DB are you using?

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [July 29, 2013, 11:16pm UTC](https://forum.inductiveautomation.com/t/historian-timestamp-interpretation/6946/3 "2013-07-29T23:16:17Z")

</div>

You can do something like this for MS SQL Server:

```python
SELECT DATEADD(s,t_stamp/1000,'1970-01-01 00:00:00') FROM sqlth_data...
```

---

<div class="post-metadata">

**Author:** ![apimente](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/apimente/32/4030_2.png) [@apimente](https://forum.inductiveautomation.com/u/apimente)\
**Post date:** [August 1, 2013, 7:39pm UTC](https://forum.inductiveautomation.com/t/historian-timestamp-interpretation/6946/4 "2013-08-01T19:39:01Z")

</div>

techerdone, Dave,

In fact I’m using MySQL, so your solution works fine. I was doing something similar, but It was a pretty dirty piece of code.

Thanks!
