SQLite的在存储时间比其他数据库不同的方法:如何选择SQLite的日期格式
SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:
**TEXT** as ISO8601 strings ("YYYY-MM-DD HH:MM:SS.SSS").
**REAL** as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar.
**INTEGER** as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.
Applications can chose to store dates and times in any of these formats and freely convert between formats using the built-in date and time functions.
什么是存储在一个SQLite数据库日期数据的最佳方式?。 TEXT,REAL还是INTEGER?
我感兴趣的东西,如“使用文本是空间占用空间,使用INTEGER是好的,但你会在2038年有很大的问题”
你需要datetime或仅日期? – Tim
datetime。长达数秒 – cprogrammer