*** 1,10 **** _By DRH on 2003-09-28_ The document describes proposed date and time functions for SQLite. ! ! There are experimental date and time functions in SQLite now. But they ! have proven to be inadequate. The proposal here incorporates lessons ! learned from the existing date and time functions. *Function Overview* --- 1,8 ---- _By DRH on 2003-09-28_ The document describes proposed date and time functions for SQLite. ! _Update: Most of the functions described here have been available ! since version 2.8.7, 2003-12-04._ *Function Overview* *************** *** 76,81 **** --- 74,80 ---- Format 9 is the julian day number expressed as a floating point value. _Please be sure to address Ticket #415 so we get full millisecond precision in julian day numbers. Unfortunately this may mean adjusting some expression test cases that depend on values rounded to fewer digits. -- e_ + It is so. --drh *Modifiers* *************** *** 87,104 **** 2: NNN hours 3: NNN minutes 4: NNN.NNNN seconds ! 5: NNN months (see #551) ! 6: NNN years (see #551) 7: start of month 8: start of year 9: start of week (withdrawn -- will not be implemented) 10: start of day ! 11: weekday N (see #551) 12: unixepoch 13: localtime 14: utc ! 15: julian (not implemented as of 5 Jan 2004) ! 16: gregorian (not implemented as of 5 Jan 2004) The first size modifiers (1 through 6) simply add the specified amount of time to the date specified by the preceding timestring. --- 86,103 ---- 2: NNN hours 3: NNN minutes 4: NNN.NNNN seconds ! 5: NNN months (see #551 and [1163]) ! 6: NNN years (see #551 and [1163]) 7: start of month 8: start of year 9: start of week (withdrawn -- will not be implemented) 10: start of day ! 11: weekday N (see #551 and [1163]) 12: unixepoch 13: localtime 14: utc ! 15: julian (not implemented as of 2004-01-05) ! 16: gregorian (not implemented as of 2004-01-05) The first size modifiers (1 through 6) simply add the specified amount of time to the date specified by the preceding timestring. *************** *** 163,173 **** calculation, then map the year back. _Please surround uses of localtime() with sqliteOsEnterMutex() and sqliteOsLeaveMutex() so threads using SQLite are protected, at least! ! -- e_ _[Consider instead, using localtime_r which is reentrant and may be used *without* expensive mutex locking. Altough non-standard it's available ! on most Unixes --hauk]_ All internal computations assume the Gregorian calendar system. When you use the "julian" modifier, it does not convert the date into a real --- 162,176 ---- calculation, then map the year back. _Please surround uses of localtime() with sqliteOsEnterMutex() and sqliteOsLeaveMutex() so threads using SQLite are protected, at least! ! -- e_ It is so. --drh _[Consider instead, using localtime_r which is reentrant and may be used *without* expensive mutex locking. Altough non-standard it's available ! on most Unixes --hauk]_ But it is not available on windows, as far as I ! am aware. --drh ! ! Date computations do not give correct results for dates before julian ! day number 0 (-4713-11-24 12:00:00). All internal computations assume the Gregorian calendar system. When you use the "julian" modifier, it does not convert the date into a real