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
精彩评论