SQLite julianday

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

SQLite julianday() function


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


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

Example-1 :

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

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

Here is the result.

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

Example-2 :

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

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

Here is the result.

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