select date(startTime, 'unixepoch','-8 hours'); SQLite's date/time functions are documented at http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
-Clark ----- Original Message ---- From: Joanne Pham <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Wednesday, December 19, 2007 9:22:39 AM Subject: [sqlite] How to truncate the hour Hi All, I have the table as defined below: hourlyAppAcclTable ( appid INTEGER, startTime INTEGER -- is number of seconds in GMT time in the integer ............. ) the values in this table is : row1 - 1, 1198990800 row 2 - 2, 1198998000 If I ran the following sql statement: select datetime(startTime, 'unixepoch','-8 hours'); I got the output as below: 12-29-2007 21:00:00 12-29-2007 23:00:00 I want to store this information in different table, dayAppAcclTable but the startTime is the day. So I want to truncate all the hour. 1, 1198915200 ( 12-29-2007 00:00:00) 2, 1198915200 (12-29-2007 00:00:00) So I want to have generic the formular/function to truncate all hours and only keep the day. Thanks in advance for your help, Joanne ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------