sqlite时间戳转时间语句(时间转时间戳)
程序员文章站
2022-03-02 18:23:07
下面是具体的实现代码:
sqlite> select datetime(1377168853, 'unixepoch', 'localtime');...
下面是具体的实现代码:
sqlite> select datetime(1377168853, 'unixepoch', 'localtime'); +------------------------------------------------+ | datetime(1377168853, 'unixepoch', 'localtime') | +------------------------------------------------+ | 2013-08-22 18:54:13 | +------------------------------------------------+ 1 row in set sqlite> select strftime('%s','now'); +----------------------+ | strftime('%s','now') | +----------------------+ | 1380728519 | +----------------------+ 1 row in set sqlite> select datetime('now'); +---------------------+ | datetime('now') | +---------------------+ | 2013-10-02 15:40:44 | +---------------------+ 1 row in set
下一篇: SQLite3中自增主键相关知识总结