w3resource

SQLite julianday() function

Description

The SQLite julianday() function returns the Julian day - the number of days since noon in Greenwich on November 24, 4714 B.C.

Syntax:

julianday(timestring, modifier, modifier, ...)

Example-1:

Compute the number of days since the day of Independence of India.

SELECT julianday('now') - julianday('1947-08-15');

Here is the result.

julianday('now') - julianday('1947-08-15')
------------------------------------------
24549.5019360879

Example-2:

Compute the time since the unix epoch in seconds (like strftime('%s','now') except includes fractional part):

SELECT (julianday('now') - julianday('1947-08-15'))*869872.568;

Here is the result.

(julianday('now') - julianday('1947-08-15'))*869872.568
-------------------------------------------------------
21354952671.2493

Previous: DATETIME
Next: STRFTIME



Follow us on Facebook and Twitter for latest update.