Tom Olson wrote:
Thank you for the reply.  I ran the select statement you sent me as well as
testing it with 'now' and both do indeed show the fractional seconds,
however if I use current_timestamp I do not see the fractional seconds. using 'now' should suffice as a workaround. Curious though?

Tom,

I confirm this discrepancy using sqlite 3.3.13. The current_timestamp does return a time rounded to the nearest second as shown by the tests below.


   sqlite> select strftime('%f', 'now');
   0.622
   sqlite> select strftime('%f', 'now');
   4.497
   sqlite> select strftime('%f', 'now');
   6.450
   sqlite> select strftime('%f', current_timestamp);
   34.000
   sqlite> select strftime('%f', current_timestamp);
   35.000
   sqlite> select strftime('%f', current_timestamp);
   36.000
   sqlite> select strftime('%f', current_timestamp);
   37.000

sqlite> create table t (id integer primary key, b default current_timestamp);
   sqlite> insert into t(id) values(NULL);
   sqlite> insert into t(id) values(NULL);
   sqlite> insert into t(id) values(NULL);
   sqlite> select * from t;
   1|2007-02-21 15:20:22
   2|2007-02-21 15:20:25
   3|2007-02-21 15:20:26
   sqlite> select id, strftime('%f', b) from t;
   1|22.000
   2|25.000
   3|26.000

You might want to file a bug report about this.

HTH
Dennis Cote


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to