SQLite doesn’t have a data type for dates.
I was wondering if it’s enough to make string comparisons between date strings like Y-m-d H:i:s (the standard sql datetime format).
For example ...WHERE date < NOW().... would this fail in certain situations?
You can store dates in SQLite with the following data types:
You can then convert these fake dates using the functions listed here.
Now, you also mentioned function
NOW()and that won’t work in SQLite. That’s for MySQL. This will show you SQLite syntax to use:So, it is highly recommended for you to use this functions and, on the other side, make sure you don’t use
NOW().