SQLite does not have a date type. You can go by storing dates as strings, but you need to specify the date YYYY-MM-DD, NOT MM-DD-YYYY. There are two main reasons for this:
(1) Correct ordering
With the dates YYYY-MM-DD, the lexicographic order is the same as the chronological order, which makes the < , > and BETWEEN operators work as expected.
This is not the case for dates MM-DD-YYYY. The query for the BETWEEN '11-15-2010' AND '12-25-2010' dates BETWEEN '11-15-2010' AND '12-25-2010' will falsely match '11-22-1963' and '12-21-2012' .
(2) Compatible with SQLite date and time functions .
They accept both string and numeric (Julian) dates, but if you pass a string to any of these functions, it must be of the order YYYY-MM-DD.
source share