I stand corrected on the math Bottom line is that different applications use different baseline values for epoch (beginning of time) and you must know that baseline value ------Original Message------ From: Kees Nuyt Sender: sqlite-users-boun...@sqlite.org To: sqlite-users@sqlite.org ReplyTo: sqlite-users@sqlite.org Sent: Mar 13, 2009 14:58 Subject: Re: [sqlite] datetime as integer
Just a few corrections. On Fri, 13 Mar 2009 13:48:46 +0000, "Timothy A. Sawyer" <tsaw...@mybowlingdiary.com> wrote: >To be able to do this you need the following data points: > >1. What is the integer representation of the date? > Is it days or seconds from a certain date? > Keep in mind that 1 day = 86400 seconds = 3600 minutes Uhm, that's 1440 minutes. >Most date representations are stored as seconds >since 1-1-1970 depending on the underlying OS > >2. Once you have figured out #1 then you need to perform > a function to convert that value to a SQLite date which > is stored as DD-MM-YYYY (or MM-DD-YYYY). SQLite accepts/recognizes date strings in the international standard form: YYY-MM-DD HH:MM:SS (ISO-8601) and a few close derivatives: http://www.sqlite.org/lang_datefunc.html http://en.wikipedia.org/wiki/ISO_8601 For date calculations, SQLite prefers real values containing number of days since noon in Greenwich on November 24, 4714 B.C., using the Proleptic Gregorian calendar: http://www.sqlite.org/lang_datefunc.html http://en.wikipedia.org/wiki/Gregorian_calendar http://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users Timothy A. Sawyer, CISSP Managing Director MBD Solutions Phone: (603) 546-7132 Web: http://www.mybowlingdiary.com Email: tsaw...@mybowlingdiary.com _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users