hey guys i’m trying to sort an excel file base on a column which are dates like this
i’m using (From row In dtFilter Order By DateTime.ParseExact(row.Item(“Database date”).ToString, “dd MMMM yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture) Ascending Select row).CopyToDataTable
i always get error when i sort it saying “string was not recognized as datetime”. i suspected it was because of the date format, so i changed all the format in the excel to dd/MM/yyyy HH:mm:ss manually(which is a lot of work) and try again with that format, and it worked perfectly.
anyone knows what date format shoud i use ? or is there another solution ?
Thank you