下面是具体的实现代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
sqlite>SELECTdatetime(1377168853,'unixepoch','localtime');
+------------------------------------------------+
| datetime(1377168853,'unixepoch','localtime') |
+------------------------------------------------+
| 2013-08-22 18:54:13 |
+------------------------------------------------+
1 rowinset
sqlite>SELECTstrftime('%s','now');
+----------------------+
| strftime('%s','now') |
+----------------------+
| 1380728519 |
+----------------------+
1 rowinset
sqlite>SELECTdatetime('now');
+---------------------+
| datetime('now') |
+---------------------+
| 2013-10-02 15:40:44 |
+---------------------+
1 rowinset
|