Sqlite does not have a datetime data type, so it does not have any TO_DATE and TO_CHAR . Dates are stored as strings.
some function for processing the date and time that ISO-8601 uses, since the lexicographic sorting in this format corresponds to the chronological sorting, which does not apply to your format, therefore, if you want to order by dates, you must use the iso format. I also suggest you use the iso format because it is not ambiguous, while slashes are used both in the DD / MM / YYYY format and in the MM / DD / YYYY format, which leads to confusion quite quickly.
Please note that functions can convert the ISO format to any format you want, so you can have your own format for reading, but there seems to be no inverse function, so you need to convert the ISO format in your application code.
source share