You are converting the "start of day" (UTC) to "localtime". Your timezone is obviously 4 hours behind UTC...
asql> SELECT datetime('now'), datetime('now','localtime'),datetime('now','start of day'),datetime('now','localtime','start of day'),datetime('now','start of day','localtime'); datetime('now') = 2015-07-29 06:28:59 datetime('now','localtime') = 2015-07-29 08:28:59 datetime('now','start of day') = 2015-07-29 00:00:00 datetime('now','localtime','start of day') = 2015-07-29 00:00:00 datetime('now','start of day','localtime') = 2015-07-29 02:00:00 -----Urspr?ngliche Nachricht----- Von: jose isaias cabrera [mailto:jicman at cinops.xerox.com] Gesendet: Mittwoch, 29. Juli 2015 07:04 An: sqlite-users at mailinglists.sqlite.org Betreff: [sqlite] datetime start of day result Greetings! if I run this command on the sqlite3 command tool, select datetime('now','localtime'); I get, sqlite> select datetime('now','localtime'); 2015-07-29 00:48:07 which is correct. When I run this command, sqlite> select datetime('now','start of day','localtime'); 2015-07-28 20:00:00 I am expecting 2015-07-29 00:00:00. What does 'start of day' does/means? Thanks. jos? _______________________________________________ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org<mailto:sqlite-users at mailinglists.sqlite.org> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___________________________________________ Gunter Hick Software Engineer Scientific Games International GmbH FN 157284 a, HG Wien Klitschgasse 2-4, A-1130 Vienna, Austria Tel: +43 1 80100 0 E-Mail: hick at scigames.at This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is confidential, privileged or legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation.