# Perspective table date showing as number

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 3, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159 "2022-05-03T13:30:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen\_Bennett](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Glen\_Bennett](https://forum.inductiveautomation.com/u/Glen_Bennett)\
**Post date:** [May 3, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/1 "2022-05-03T13:30:50Z")

</div>

I have a table I am showing in perspective and my time stamp is displaying as a number instead of a date. when I execute the name query is shows as a date. the column is listed as date format and showing the date in the dataset editor. but for some reason it is displaying as a number in the table.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 3, 2022, 1:43pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/2 "2022-05-03T13:43:10Z")

</div>

configure the table columns in the `columns` property:

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

make sure you set up the `field` property, assign it the column name. This should fix it.

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [May 3, 2022, 1:43pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/3 "2022-05-03T13:43:20Z")

</div>

Hi @Glen_Bennett,

under the table properties you can add columns definitions  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/3/f31801e42d01d4d08e34ee404a9ea64487acd681.png)  
in field set the name of the column you want to adapt  
render set to date  
set the correct date format.

You will need to do this for each column you want to visualize in your table

Regards

---

<div class="post-metadata">

**Author:** ![Glen\_Bennett](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@Glen\_Bennett](https://forum.inductiveautomation.com/u/Glen_Bennett)\
**Post date:** [May 3, 2022, 1:45pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/4 "2022-05-03T13:45:28Z")

</div>

That fixed it. Thanks!

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [February 16, 2023, 2:51am UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/5 "2023-02-16T02:51:54Z")

</div>

to add onto that question, when the field is editable it pops up as a number. Any suggestions?

---

<div class="post-metadata">

**Author:** ![Rayl\_Morris1](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@Rayl\_Morris1](https://forum.inductiveautomation.com/u/Rayl_Morris1)\
**Post date:** [February 4, 2025, 3:09pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/6 "2025-02-04T15:09:50Z")

</div>

I solved this problem by holding the data in a custom property and creating a binding from that property to `<Table>.props.data`, with a script transform to use the `system.dataset.formatDates` function. I then store any edits to the custom property (or directly to a database, as need be), which refreshes the `props.data` binding automatically.

You can use the function directly in the same binding that gets the data if reading from an external data source, but it will change the column to String, which will accept any value and lose the automatic translation that Date columns have.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 4, 2025, 3:24pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/7 "2025-02-04T15:24:44Z")

</div>

Welcome to the forum, Ray.

> [@Rayl\_Morris1](#):
>
> but it will change the column to String

That's the problem with your solution.  
The advice is to always keep dates as date types until the point of display to a human. That way you can still perform calculations, database inserts, accommodate timezones, etc.

Arnoud's solution [Perspective table date showing as number - #3 by Arnaud\_Declerck](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/3) is the correct one. Add the database column name to the column's `field` property, render as date and then the formatting will all work.

---

<div class="post-metadata">

**Author:** ![Rayl\_Morris1](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@Rayl\_Morris1](https://forum.inductiveautomation.com/u/Rayl_Morris1)\
**Post date:** [February 4, 2025, 3:46pm UTC](https://forum.inductiveautomation.com/t/perspective-table-date-showing-as-number/59159/8 "2025-02-04T15:46:16Z")

</div>

Agreed, good callout. If you don't need the ease of editing a human-readable date in place, **using the render property on the column maintains the greatest amount of functionality**. The specific problem my solution solves, and that which Arnaud's solution leaves unsolved, is that changing the render property only solves the formatting for displaying while not editing and for writing back to the dataset.

This is enough for most cases, but if editing the cell directly (as opposed to through an embedded view or other UI component) the date displayed _when_ editing is the millisecond unix timestamp.

The reason for having a background property driving as the "actual" dataset is to get the formatting a similar level of distance away from the data as the render property gets natively.
