JULIANDAY
Returns the Julian day - the number of days since noon in Greenwich on November 24, 4714 B.C. (Proleptic Gregorian calendar).
See also:
[SELECT] [ Date Modifiers ]
Syntax
SELECT JULIANDAY(datetime_expression [, modifier, ...]) FROM <multipartIdentifier>;
Arguments
datetime_expression
The datetime value.
modifier
Zero or more modifiers to be applied to the datetime_expression. For more information about modifiers, see Date Modifiers
Return Value(s)
Returns the Julian day of the input datetime_expression with the modifier applied: the number of days, including the fraction for the time of day, since noon in Greenwich on November 24, 4714 BC in the proleptic Gregorian calendar.
Examples
Calculate the days between two dates
SELECT name, timeCreated,
round(julianday('now')-julianday(timeCreated)) as days_since
FROM google.storage.buckets WHERE project = 'stackql';
tip
Use the ROUND function to convert floating point numbers to the nearest integer.
For more information, see https://www.sqlite.org/lang_datefunc.html