开发者

SQLite - current_timestamp doesn't return the right hour?

In the SQLite IDE SQL window, I've written the instruction to return the the equivalence of .NET DateTime.Now, which is CURRENT_TIMESTAMP.

Let's say it is开发者_如何学JAVA 10:47:00 in local time, that is, GMT -4:00 (on summertime), otherwise it is GMT -5:00.

The result of my query:

select current_timestamp

returns 2010-09-23 14:47:00, regardless of my local machine time.

How can I make SQLite use my local time instead of GMT?

Thanks everyone! =)


Use select datetime(current_timestamp, 'localtime');

You can get more info on the date/time functions here

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜