Will Marcouiller
Will Marcouiller

Reputation: 24132

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 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! =)

Upvotes: 0

Views: 3697

Answers (1)

rickythefox
rickythefox

Reputation: 6851

Use select datetime(current_timestamp, 'localtime');

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

Upvotes: 3

Related Questions