Skip to main content

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 representing the date component of the input datetime_expression with the modifier applied.


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 to convert floating point numbers to the nearest integer.

For more information, see https://www.sqlite.org/lang_datefunc.html