# Reporting - datetime formating

**URL:** <https://forum.inductiveautomation.com/t/reporting-datetime-formating/93154>\
**Category:** Ignition\
**Tags:** reporting, perspective\
**Created:** [July 12, 2024, 4:14pm UTC](https://forum.inductiveautomation.com/t/reporting-datetime-formating/93154 "2024-07-12T16:14:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![petr.sasin](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@petr.sasin](https://forum.inductiveautomation.com/u/petr.sasin)\
**Post date:** [July 12, 2024, 4:14pm UTC](https://forum.inductiveautomation.com/t/reporting-datetime-formating/93154/1 "2024-07-12T16:14:37Z")

</div>

Hi,

I'm reading data from a Microsoft SQL Server (MSSQL) database table. One column, named `TSCreated` , stores timestamps in milliseconds (standard UNIX Epoch time) as a BigInt data type, not a datetime.

When I display the data using a named query in a Perspective table, I can set the render type for the `TSCreated` column to "date" and it displays the datetime in the correct format. However, if I display the same named query in a report, `TSCreated` is shown as a number, not a datetime (see attached screenshot).

**How can I instruct the reporting module to display the `TSCreated` column as a date?**

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

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 12, 2024, 4:19pm UTC](https://forum.inductiveautomation.com/t/reporting-datetime-formating/93154/2 "2024-07-12T16:19:45Z")

</div>

If you can't/won't change the query to do the casting to a true date time type (this is the best place to do it) you'll need to use a script data source to rewrite the column using a system.date function to parse the millis into a Java Date object.

You could use a script like this to do the column update:

> [@Can I modify an entire column from a dataset with system.dataset.setValue()?](https://forum.inductiveautomation.com/t/can-i-modify-an-entire-column-from-a-dataset-with-system-dataset-setvalue/87043/3):
>
> def mapColumn(function, dataset, column): if isinstance(column, basestring): column = dataset.getColumnIndex(column) columnData = map(function, dataset.getColumnAsList(column)) columnsToKeep = range(dataset.columnCount) columnsToKeep.pop(column) dsWithoutColumn = system.dataset.filterColumns(dataset, columnsToKeep) return system.dataset.addColumn( dsWithoutColumn, column, columnData, dataset.getColumnName(column), dataset.getColumnType(column) ) It's relatively easy to…
