Datatables sorting time column <p>I'm using jQuery DataTables and I have a problem when I'm sorting my time column with this format <code>mm:ss</code>. For example when I sort this <code>00:08</code> the sort does something but this is not good. I have in my column:</p> <pre><code>00:08 00:15 00:01 01:20 00:16 02:11 </code></pre> <p>So the sort doesn't work. Do you know how can I sort my time column?</p> <p>Here is my code : </p> <pre><code>$('#table').DataTable({ dom: "t&lt;'col-sm-5'i&gt;&lt;'col-sm-7'p&gt;", autoWidth: false, serverSide: true, aaSorting: [[0, 'desc']], rowId: 'id', lengthChange: false, ajax: { url: 'index', method: 'POST' } columns: [ {data: "id", width: '5%'}, {data: "name", width: '10%', orderData: [ 1, 0 ]}, {data: "user_name", width: '10%', orderData: [ 2, 0 ]}, {data: "email", width: '35%', orderData: [ 3, 0 ]}, {data: "duration", render: duration_time, width: '10%', type: "time",orderData: [ 4, 0 ]}, {data: "incomplete", render: incomplete, width: '30%', orderData: [ 5, 0 ]} ] }); </code></pre> <p>Here is the function for the render parameter :</p> <pre><code>function duration_time(data, type, dataToSet){ var start = dataToSet.date_start; var end = dataToSet.date_end; var time = moment.utc(moment(end, "YYYY-MM-DD HH:mm:ss").diff(moment(start, "YYYY-MM-DD HH:mm:ss"))).format("mm:ss"); return time; } function incomplete(data, type, dataToSet){ return dataToSet.incomplete == 0 ? 'Complete' : 'Incomplete'; } </code></pre>