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

时间:2014-06-26 13:00:29   收藏:0   阅读:247

sqlite时间戳转时间、时间转时间戳的方法

实现代码:

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时间戳转时间语句(时间转时间戳)实例,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!