On 8/14/19, Adrian Ho <ml+sql...@03s.net> wrote:
> Here's a Dirty Little Secret: All the SQLite date functions are centered
> around strftime(), which is not implemented in a strictly correct sense
> in *every* Unix-like platform I've seen.

Not true.

SQLite implements its own date and time computations, based on
algorithms taken from Astronomical Algorithms, 2nd Edition, 1998,
ISBN 0-943396-61-1. See https://sqlite.org/src/file/src/date.c for the
latest source code.

An obscure exception is if you compile with
-DSQLITE_OMIT_DATETIME_FUNCS.  In that case SQLite does invoke the
system strftime() routine as a fallback implementation for the
keywords CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP.  But this
only happens when you use the obscure -DSQLITE_OMIT_DATETIME_FUNCS
compile-time option. I am aware of nobody who actually does that.

You can verify the above claim by running "nm" (on many unix systems,
or the equivalent on Mac or Windows) on a compiled sqlite3.o file, and
seeing that "strftime" appears nowhere in the output, while library
routines that SQLite does use like "open", "read", and "malloc" do
appear in the output.
-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to