I seem to be having an odd behavioral problem with calculating time stamps.
The software I'm using drops data into a field as a local time stamp (IE: '2010-10-18 04:08:04.000') which is fine. However, when trying to pull that data back out and convert the Sqlite NOW time to local, I'm getting extremely odd results. For instance: select strftime('%s','now') RealUTC,strftime('%s','now','localtime') LocalTime, strftime('%s','now') - strftime('%s','now','localtime') Yeilds results of: RealUTC LocalTime strftime('%s','now') - strftime('%s','now','localtime') ---------- ---------- ------------------------------------------------------------- 1287389442 1290053442 -2664000 I'm currently sitting in -0400 (EDT) and there should only be a maximum of 14,400 seconds. 2664000 seems to add up to just under 31 days. Now, I'm writing the code that does the database management, and I've modified it so that when inserting/updating the time, its done with the date('2010-10-18 04:08:04','utc') to do the conversion, and the math works without using UTC or LOCALTIME in the strftime functions but I'd still like to know why the above SQL statement bombs? _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users