# Table - Date formatting with json

**URL:** <https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 28, 2021, 6:04pm UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317 "2021-07-28T18:04:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakned](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jakned](https://forum.inductiveautomation.com/u/jakned)\
**Post date:** [July 28, 2021, 6:04pm UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/1 "2021-07-28T18:04:30Z")

</div>

Hi,  
I am working on a overview table and I ran into a problem.

On data property I have a query binding that returns some data including dates.

If I select “dataset” as a return format. Everything works just fine. I can format the date.  
If I select “json” as a return format then the dates come in as timestamp (I guess, see the picture) and I cannot format them.

I would like to use json as a return format because it makes it easier for me to color the background based on some conditions. Can I make it work with json too?

Json:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6d505ae0e9e4c4dd658f46b7811148501ca54b93.png)

Dataset:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/8/484ba379243f3d52a17cecc0cd0147ed2545a860.png)

Thanks for any advice!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [July 29, 2021, 6:32am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/2 "2021-07-29T06:32:51Z")

</div>

if you add items to the column prop you should be able to select a type and format for them

---

<div class="post-metadata">

**Author:** ![jakned](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jakned](https://forum.inductiveautomation.com/u/jakned)\
**Post date:** [July 29, 2021, 7:24am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/3 "2021-07-29T07:24:03Z")

</div>

I do have columns set up in the columns prop but It just considers it a number not a date.

I tried to do system.date.fromMillis() on each of those but that ends up as a string.

---

<div class="post-metadata">

**Author:** ![jakned](https://avatars.discourse-cdn.com/v4/letter/j/4da419/32.png) [@jakned](https://forum.inductiveautomation.com/u/jakned)\
**Post date:** [July 29, 2021, 7:37am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/4 "2021-07-29T07:37:26Z")

</div>

Alright. I had to set the render to date like so:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/a/aa59a28b8e71eb4daa7fdade12d53b7f801e3b80.png)

Seems like with dataset it can decide what kind of column is it.

---

<div class="post-metadata">

**Author:** ![kpmalik](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kpmalik](https://forum.inductiveautomation.com/u/kpmalik)\
**Post date:** [December 12, 2024, 7:11am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/5 "2024-12-12T07:11:21Z")

</div>

I am having issues formatting date in the table.. DATE is the only column in the table and here's what I have in Named Query Results, Table Results and Column settings in property editor of the table... Appreciate if I can get any help here:

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

---

<div class="post-metadata">

**Author:** ![mpoulsen921](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mpoulsen921](https://forum.inductiveautomation.com/u/mpoulsen921)\
**Post date:** [December 12, 2024, 8:58am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/6 "2024-12-12T08:58:07Z")

</div>

You need to add the column name in the field property:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7e1f7e874cb424ec9a28cc18774a0c5b324aff3c.png)

---

<div class="post-metadata">

**Author:** ![kpmalik](https://avatars.discourse-cdn.com/v4/letter/k/3ec8ea/32.png) [@kpmalik](https://forum.inductiveautomation.com/u/kpmalik)\
**Post date:** [December 12, 2024, 9:21am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/7 "2024-12-12T09:21:54Z")

</div>

OMG..... THANK YOU @mpoulsen921...

You're awesome... Thank you so much!!

---

<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:** [December 12, 2024, 9:23am UTC](https://forum.inductiveautomation.com/t/table-date-formatting-with-json/49317/8 "2024-12-12T09:23:28Z")

</div>

Yes, for many of the table column properties to work the `field` property has to be set to an exact match of the column name. If things don't work as expected it's worth checking this.
