Kenneth Lo wrote:
I think the time() function is not reporting the correct time. The date part
is OK. I also note that CVSTrac uses C codes to handle datetime i.e. not relying
on sqlite. Is there a bug?

Some investigation ... bash-2.05b$ date Wed Mar 31 11:12:03 HKT 2004 bash-2.05b$ sqlite SQLite version 2.8.12 Enter ".help" for instructions sqlite> SELECT strftime('%s','now'); 1080701286 sqlite> select datetime(1080701286,'unixepoch'); 2004-03-31 02:48:06 sqlite> select datetime(1080701286,'localtime'); 2954147-07-10 19:59:59 sqlite> select datetime('now'); 2004-03-31 02:49:07


Looks like it isn't rounding the right way someplace. SQLite computes dates internally using Julian Day Numbers, which means that the seconds are represented as a tiny fraction of a day. In hindsight, this is probably a bad idea since it tends to lead to roundoff errors of this kind. On the other hand, I suppose it isn't too late to change it....

As for CVSTrac using its own date/time functions, that's
because CVSTrac was written long before I added date/time
functions to SQLite.


-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to