SQLite doesn't support DATE/DATETIME data type. Therefore datetime can be presented in database as unix timestamp e.g. integer, number of seconds since Jan 01 1970 or as IS0-8601 string
YYYY-MM-DD HH:MM:SS
When datetime is stored as unix timestamp we can perform queries like this:
select * from table where c1 < datetime(1452598502, 'unixepoch', 'localtime')
Also if date is stored as string in the form:
2016-01-10 15:44:42
queries like upper are still correctly executed (lexicographical comparison on the strings will match datetime comparison).
select * from table where c1 < '2016-01-10 15:43:52'
Futher more unix timestamp has max value year 2038, afterthat it's overflow. YYYY has maximum date 9999. Both have a max value. Is there any advantage one over another? I just can't seem to prefer one over another. Maybe I prefer datetime as string YYYY-MM-DD HH:mm:ss as it has max value greater than unixtimestamp.