# Sort Dataset by date in european notation

**URL:** <https://forum.inductiveautomation.com/t/sort-dataset-by-date-in-european-notation/44214>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [March 8, 2021, 9:41am UTC](https://forum.inductiveautomation.com/t/sort-dataset-by-date-in-european-notation/44214 "2021-03-08T09:41:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [March 8, 2021, 9:41am UTC](https://forum.inductiveautomation.com/t/sort-dataset-by-date-in-european-notation/44214/1 "2021-03-08T09:41:52Z")

</div>

Hi,  
I have an historical binding on a table that outputs some values with its registration date.  
When I try to sort the table so it’s displayed in discending order (from the newest data to the oldest) I get a strange order, probably because ignition doesn’t recognized the date format DD/MM/YYYY.

 ![storico_descending_1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/097aa5138714a67b5908188c54b0dc5a9ef0310b.png)  
 ![storico_descending_2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/739ed8c5c6a3455c995f0388375b4f2428156055.png)  
Any solution?  
Thanks

Daniele

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [March 8, 2021, 1:59pm UTC](https://forum.inductiveautomation.com/t/sort-dataset-by-date-in-european-notation/44214/2 "2021-03-08T13:59:08Z")

</div>

Having the Perspective table component do the sorting on date columns has never been quite right. It converts all of the dates to strings and then sorts them in ASCII order.

The best we ever found was sorting the data while still in dataset format before providing it to the Perspective component:

> [@\[Bug-2737\] Perspective table - sorting date column](http://forum.inductiveautomation.com/t/perspective-table-sorting-date-column/31213/9):
>
> In the long run, we used something similar to this as a transform on our dataset binding, so the table is pre-sorted by dates: def sort\_dataset\_by\_date(dset, date\_column, ascending=True): orig\_columns = system.dataset.getColumnHeaders(dset) tstamps = [system.date.toMillis(x) for x in dset.getColumnAsList(date\_column)] dset = system.dataset.addColumn(dset, 0, tstamps, 'tmp\_tstamp', long) dset = system.dataset.sort(dset, 0, ascending) return system.dataset.filterColumns(dset, orig\_columns) I…

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 9, 2021, 12:59pm UTC](https://forum.inductiveautomation.com/t/sort-dataset-by-date-in-european-notation/44214/3 "2021-03-09T12:59:54Z")

</div>

> [@justin.brzozoski](#):
>
> converts all of the dates to strings and then sorts them in ASCII orde

If that's the case, then should be able to use ISO 8601 date format (yyyy-MM-dd)

---

<div class="post-metadata">

**Author:** ![daniele1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/daniele1/32/31531_2.png) [@daniele1](https://forum.inductiveautomation.com/u/daniele1)\
**Post date:** [March 9, 2021, 1:39pm UTC](https://forum.inductiveautomation.com/t/sort-dataset-by-date-in-european-notation/44214/4 "2021-03-09T13:39:01Z")

</div>

I read the discussion with your answer in it and I saw that the user lwood suggested to set the column to auto instead of date (in the properties tree just set “render:auto”) and it worked out for me.
