# T\_stamp format of historian

**URL:** <https://forum.inductiveautomation.com/t/t-stamp-format-of-historian/68837>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 20, 2023, 10:24am UTC](https://forum.inductiveautomation.com/t/t-stamp-format-of-historian/68837 "2023-01-20T10:24:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dharani\_T](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@Dharani\_T](https://forum.inductiveautomation.com/u/Dharani_T)\
**Post date:** [January 20, 2023, 10:24am UTC](https://forum.inductiveautomation.com/t/t-stamp-format-of-historian/68837/1 "2023-01-20T10:24:22Z")

</div>

Hi,

I am using system.tag.queryTagHistory to get the historian values of certain tags.  
But when i try to export the table to csv, i noticed that t\_stamp format is displaying as below,  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/d/7db4253182f54ac93dc052cba971efed2fe9f2a2.png)  
only when clicking on cell, full datetime is getting displayed. Any suggestions to overcome this?

---

<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:** [January 20, 2023, 12:44pm UTC](https://forum.inductiveautomation.com/t/t-stamp-format-of-historian/68837/2 "2023-01-20T12:44:17Z")

</div>

Format the column in the spreadsheet. Or open the CSV in a text editor. (Your spreadsheet program is doing this, not Ignition.)

Or, better yet, don't use CSV if you are going to open in a spreadsheet program. Use the Excel export tools instead.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 20, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/t-stamp-format-of-historian/68837/3 "2023-01-20T12:53:24Z")

</div>

This is an Excel issue, not an Ignition issue. That said, Excel is very, _very_ bad at this. EDIT: Phil beat me to that point.

Unfortunately, even using the built-in functions, Excel rarely uses a useful format.

I updated this function to allow an arbitrary date format, or use the deafult 'yyyy-MM-dd HH:mm:ss'.

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/7):
>
> The [Apache POI](https://poi.apache.org/apidocs/4.1/index.html) libraries are included with Ignition. At the time I was only needing to read files, so xlrd was all that was necessary. I'm just starting to dig into POI, myself, but here's a start: EDIT 2021-08-23: Updated to allow JsonDataSets. Changed to allow for a ByteArray output instead of writing to a file. EDIT 2023-01-20: Added option for date formats. Default is 'yyyy-MM-dd hh:mm:ss'. EDIT 2023-05-12: Added options for first row and column, if needed to offset from A1 def datasetT…
