Sorting these timestamps into order is really easy, because actually you do not need to convert to date numbers or numeric values at all! You can simply apply sortrows directly to the data table.
This is because that particular date format can be sorted into date/time order simply by using a standard character sort, because it naturally progresses from the highest unit to the lowest unit. This format is essentially the ISO 8601 date format, and the fact it can be sorted into time/date order without any conversions being applied is one of its main advantages. Note this does not apply to other date formats.
I do not have tables in my MATLAB version, but sortrows can also be applied to tables:
A ={73268, 'p.vc008k1e7t0', '2014-10-20 00:27:20.597';
73269, 'p.vc002k50e4t0', '2014-10-20 00:40:57.592';
83318, 'p.vc008k30e4t3r','2015-03-24 22:26:15.492';
83320, 'p.vc008k30e4t4r','2015-03-24 22:33:09.896';
83445, 'p.vc001k1e5t0', '2015-03-27 06:12:21.340';
74282, 'p.vb001k1e5t0', '2014-10-30 17:16:03.727';
83446, 'p.vl00nk1e5t0', '2015-03-27 06:41:08.516';
83447, 'p.vl00nk1e5t1', '2015-03-27 07:12:10.958';
83448, 'p.vl00nk1e5t0', '2015-03-27 07:34:44.090';
80617, 'p.vl00nk1e5t1', '2014-11-26 12:24:45.325';
80618, 'p.vl00nk1e5t2', '2014-12-01 00:53:45.365'};
>> [out,idx] = sortrows(A,3) % 3 picks the column that we want to sort by
out =
[73268] 'p.vc008k1e7t0' '2014-10-20 00:27:20.597'
[73269] 'p.vc002k50e4t0' '2014-10-20 00:40:57.592'
[74282] 'p.vb001k1e5t0' '2014-10-30 17:16:03.727'
[80617] 'p.vl00nk1e5t1' '2014-11-26 12:24:45.325'
[80618] 'p.vl00nk1e5t2' '2014-12-01 00:53:45.365'
[83318] 'p.vc008k30e4t3r' '2015-03-24 22:26:15.492'
[83320] 'p.vc008k30e4t4r' '2015-03-24 22:33:09.896'
[83445] 'p.vc001k1e5t0' '2015-03-27 06:12:21.340'
[83446] 'p.vl00nk1e5t0' '2015-03-27 06:41:08.516'
[83447] 'p.vl00nk1e5t1' '2015-03-27 07:12:10.958'
[83448] 'p.vl00nk1e5t0' '2015-03-27 07:34:44.090'
And that is it no conversions required! To sort another table with the same order, just use the second output idx:
other_table(idx,:)
