Skip to content Skip to sidebar Skip to footer

Sqlite Date Difference

I need to get the Sqlite date difference. I found a way like this sqlite> SELECT julianday('now') - julianday('1776-07-04'); But this gives the output like this. 86798.70946950

Solution 1:

You can try casting your expression to an Integer if you only want whole number days:

SELECTCAST(JULIANDAY('now') - JULIANDAY('1776-07-04')) AsINTEGER

See here for more information.

Post a Comment for "Sqlite Date Difference"