Dates and Times in SQLite
April 1, 2009
SQLite does note have a date-time type, however it can manipulate dates and times stored in several different formats. Specifically, dates can be stored as strings in the following forms:
- YYYY-MM-DD
- YYYY-MM-DD HH:MM
- YYYY-MM-DD HH:MM:SS
- YYYY-MM-DD HH:MM:SS.SSS
- YYYY-MM-DDTHH:MM
- YYYY-MM-DDTHH:MM:SS
- YYYY-MM-DDTHH:MM:SS.SSS
- HH:MM
- HH:MM:SS
- HH:MM:SS.SSS
- now
- DDDD.DDDD
See also: the thread Retrieving date on sqlite-users
.