My date format is "yyyy-MM-dd" (2017-03-23)
My time format is "hh: mm a" (10:15 pm)
If in MYSQL you can do this to convert time with am / pm:
SELECT * FROM table_name ORDER BY STR_TO_DATE(timeField,'%h.%i%p');
How can you do this in SQLITE?
I tried this but did not work:
SELECT appointment_date, start_time FROM appointment order by appointment_date, DATE(start_time, '%h:%i %p')
Result:
Image link
Presumably, AM should be the first than PM, because by default ASC, I also tried to use DESC, but it did not order the result correctly.
source
share