开发者

Sqlite couldn't show the correct current time

I have set my time as US Locale.I have made database in Sqlite.In database i have fields like Entry_Date which set as CURRENT_TIMESTAMP..Now i run query like

   SELECT time('now')

o/p:  06:22:09

It display wrong time.so my que开发者_如何学运维stion is How do i set the Sqlite time?


You need to pass the localtime modifier to the time function.

sqlite> select time('now','localtime');
06:38:51

See Date and Time Functions

Update: For the record, here's how to output a unix epoch date:

sqlite> select time(1316638370,'unixepoch','localtime');
06:52:50
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜