If I insert a date into a SQLite DB like so:

CREATE TABLE TestDate (foo);
INSERT INTO TestDate VALUES ('2004-08-19 11:57:41');

and then select the data out:

SELECT strftime("%s",foo) FROM TestDate;
Output: 1092916661

Which is off by 7 hours, which I'm assuming is because SQLite assumes that the date I entered in the DB was in UTC time (which it's not it's compensated to my localtime zone). Is there any way to have SQLite be aware that the date entered is not UTC? Can I append the timezone on the end of the string?

Also when calculating dates using the 'localtime' modifier where does SQLite get the information regarding the local timezone? Is it an environment variable somewhere?

http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Reply via email to