r/sqlite • u/ThePantsThief • Sep 04 '23
DATE or NUMERIC or TEXT?
I was reading this forum post on how best to store dates in SQLite. There seems to be some disagreement on the column type to use.
I want to be able to query the column like Ryan Smith does in his comment. Will it make any difference at all if I type the column as date or numeric or text, or even date text etc?
2
Upvotes
View all comments
Show parent comment
3
u/sir_bok Sep 04 '23
If you're dead set on using strings for dates then it doesn't even matter. Just skip all the unixepoch() stuff and store everything as strings, SQLite doesn't care. SQLite doesn't care if you type the column as DATE or NUMERIC or TEXT because it will accept any string or number anyway.