Title: Date sort
Last modified: January 31, 2018

---

# Date sort

 *  Resolved [foscone](https://wordpress.org/support/users/foscone/)
 * (@foscone)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/date-sort-3/)
 * Hi, is there a way to sort date-time column?
    If I try it sorts like: 01/11/2017
   18:22 01/12/2017 05:40 01/12/2017 20:17 02/11/2017 10:31 02/11/2017 16:18 02/
   11/2017 17:38 02/12/2017 23:55 03/11/2017 16:07 03/11/2017 20:44 03/11/2017 22:
   01 …
 * This dates are generated in php foreach:
 *     ```
       <table class="tablesorter {sortlist: [[0,0]]}">
        <thead>
         <tr><th>Date</th></tr>
        </thead>
        <tbody>
         <?php
         foreach ( $sent_list as $lista ) { ?>
          <tr>
           <td>
            <?php
            $date= new DateTime($lista[ts]);
            echo $date->format('d/m/Y H:i');
            ?>
           </td>
          </tr>
         <?php } ?>
        </tbody>
       </table>
       ```
   
 * I can’t share link because is in a private area, sorry.
    Thanks Fosco
    -  This topic was modified 8 years, 4 months ago by [foscone](https://wordpress.org/support/users/foscone/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [dkolski](https://wordpress.org/support/users/dkolski/)
 * (@dkolski)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/date-sort-3/#post-9928055)
 * I had the same problem and solved in modifying the jquery.tablesorter.min.js 
   file where I changed the date format parameter as follow :
 * dateFormat:”ddmmyyyy”
 * This parameter is located near the begining of the php file.
 * You may also be interested in another change if you want to sort numeric value
   with comma as decimal separator.
 * Change the follwing parameter :
 * usNumberFormat:!1
 * I hope this can help.
 *  Plugin Author [Farhan Noor](https://wordpress.org/support/users/farhannoor/)
 * (@farhannoor)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/date-sort-3/#post-9933144)
 * Hi,
 * To make your date columns sortable, add this class in your Date column head **
   dateFormat-dd/mm/yyyy**
 * You should do it like this `<th class="dateFormat-dd/mm/yyyy">Date</th>` You 
   can change date format according to your own need.
 * Cheers. Happy coding!
 *  [dkolski](https://wordpress.org/support/users/dkolski/)
 * (@dkolski)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/date-sort-3/#post-9933674)
 * Not sure you shoud include the “/” in the dateFormat. ddmmyyyy should work
 *  Thread Starter [foscone](https://wordpress.org/support/users/foscone/)
 * (@foscone)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/date-sort-3/#post-9937916)
 * Thank you, also for me `<th class="dateFormat-ddmmyyyy">Date</th>` works.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Date sort’ is closed to new replies.

 * ![](https://ps.w.org/table-sorter/assets/icon-256x256.jpg?rev=1447744)
 * [Table Sorter](https://wordpress.org/plugins/table-sorter/)
 * [Support Threads](https://wordpress.org/support/plugin/table-sorter/)
 * [Active Topics](https://wordpress.org/support/plugin/table-sorter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/table-sorter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/table-sorter/reviews/)

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [datetime](https://wordpress.org/support/topic-tag/datetime/)

 * 4 replies
 * 3 participants
 * Last reply from: [foscone](https://wordpress.org/support/users/foscone/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/date-sort-3/#post-9937916)
 * Status: resolved