SQLite JULIANDAY() Function
Definition and Usage
The JULIANDAY() function returns the Julian day number: the number of days since noon on November 24, 4714 BC, as a decimal number.
It is useful for calculating the number of days between two dates.
Syntax
JULIANDAY(time_value, modifier, ...)
Parameter Values
| Parameter | Description |
|---|---|
| time_value | Required. A date or time, like '1996-07-04', '1996-07-04 14:30:00' or 'now' |
| modifier | Optional. Modifiers that change the date or time, like '+7 days', '-1 month', 'start of month', 'start of year', 'weekday 0' (the next Sunday) and 'localtime' |
Technical Details
| Return type: | Real |
|---|
More Examples
Example
Return the number of days between two dates:
SELECT JULIANDAY('1997-02-12')
- JULIANDAY('1996-07-04');
Try it Yourself »