Calculating Difference (diff) between Date and Time using SQLite
To calculate difference between dates and time using SQLite database, you can use this SQL below:
.
.
SELECT cast((strftime('%s','now') - strftime('%s','2008-05-08 18:00:00')) AS 'float') / 60 AS minutes
or
SELECT cast((strftime('%s','now') - strftime('%s',tablefield)) AS 'float') / 60 AS minutes FROM TABLE
Note: use cast..float for more accurate results.
;)
Deixe o seu comentário