I believe my solucion adds more columns to the Datatable, where we can save every part of the DateTime :
Tabla.Columns.Add("year", typeof(DateTime)); Tabla.Columns.Add("month", typeof(DateTime)); Tabla.Columns.Add("day", typeof(DateTime));
then we can sort our datatable with a DataView :
DataView myDataView = DT.DefaultView; case 1: ASC myDataView.Sort = "year asc, month asc, day asc"; case 2: DESC myDataView.Sort = "year desc, month desc, day desc"; Tabla = myDataViwe.toTable();
the result is our data type, sorted for dateTime
source share