On 28 Nov 2017, at 3:50pm, no...@null.net wrote:

> Can someone point me to the documentation for behaviour of date/time
> functions inside transactions? In my code it appears time is frozen.

Correct.  The value of 'now' is frozen at the time a transaction begins.  This 
is to ensure that if many rows are created/updated (perhaps even in different 
tables) they are all assigned the same timestamp.

If you need to record, instead, the timestamp that data was entered into your 
user-interface, then you need to record that time in your programming language, 
not rely on when the data hits SQL.

> The command-line client on the other hand doesn't behave the same way:
> 
>       sqlite> begin immediate;
>       sqlite> select julianday();
>       julianday()
>       ----------------
>       2458086.15509343
>       sqlite> select julianday();
>       julianday()
>       ----------------
>       2458086.15511422
> 
> I'm guessing that the CLI is kind of broken

That’s an interesting observation and I am surprised by it.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to