您的位置:首页技术文章
文章详情页

sqlite时间戳转时间语句(时间转时间戳)

【字号: 日期:2023-04-05 14:56:07浏览:159作者:猪猪

下面是具体的实现代码:

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
标签: SQLite
相关文章: