sqlite - Difference in seconds between timestamps in Sqlite3 -
is possible difference (in seconds) between 2 timestamp values in sqlite3?
for instance, i've tried following query:
select current_timestamp - my_timestamp my_table;
and '0'. can tell me i'm doing wrong? (note, have verified my_timestamp indeed in past.)
got it:
select (julianday(current_timestamp) - julianday(my_timestamp)) * 86400.0) my_table;
julianday
returns fractional number of days since noon in greenwich on november 24, 4714 b.c. take difference , multiply number of seconds per day.
Comments
Post a Comment