# History Partitions on Historisation Tags

**URL:** <https://forum.inductiveautomation.com/t/history-partitions-on-historisation-tags/2169>\
**Category:** Archived Topics\
**Created:** [September 2, 2010, 10:47am UTC](https://forum.inductiveautomation.com/t/history-partitions-on-historisation-tags/2169 "2010-09-02T10:47:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oriol](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@Oriol](https://forum.inductiveautomation.com/u/Oriol)\
**Post date:** [September 2, 2010, 10:47am UTC](https://forum.inductiveautomation.com/t/history-partitions-on-historisation-tags/2169/1 "2010-09-02T10:47:10Z")

</div>

Hi,

I need to get the value of some historised tag.  
As I know the moment (datetime), I’ve to get the name of the partition of history data inside the table sqlt\_partitions. But the question is: how are the columns start\_time and end\_time represented? which format do they use? I saw those columns are bigint format, but if I need to filter in two datetimes, I have to convert to the correct format.  
How can I know what dates includes in each partition?

For example: the table sqlt\_partitions indicates that some partition of history tags is include between start\_time and end\_time. But, which are these dates?

Thanks.

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [September 3, 2010, 3:54pm UTC](https://forum.inductiveautomation.com/t/history-partitions-on-historisation-tags/2169/2 "2010-09-03T15:54:48Z")

</div>

The timestamps are stored in millisecond level unix-timestamp format (milliseconds since 1970, utc). This is for several reasons, but one is so that we can get MS level accuracy even with databases like MySQL, which don’t support milliseconds.

To convert to a date, you’ll have to use a function appropriate for your database. For mysql, for example, you could do:

```auto
SELECT from_unixtime(start_time/1000) FROM sqlth_partitions
```

The “/1000” is necessary because, like I said, MySQL doesn’t support milliseconds.

Regards,

---

<div class="post-metadata">

**Author:** ![Oriol](https://avatars.discourse-cdn.com/v4/letter/o/7cd45c/32.png) [@Oriol](https://forum.inductiveautomation.com/u/Oriol)\
**Post date:** [September 7, 2010, 8:47am UTC](https://forum.inductiveautomation.com/t/history-partitions-on-historisation-tags/2169/3 "2010-09-07T08:47:59Z")

</div>

Thanks a lot.

Now, I have another question in the same way to history tags.  
I need to know how are called the tables of history data. If you configure data to be partitioned year by year, does the sqlt\_data\_… table follow any rule to get the name of it?  
Deppending on the year, can you know which table you have to go in order to get the values from that year?

Thanks in advance.
