Вы можете использовать функцию julianday()
следующим образом:
SELECT t.*,
round((julianday(t."Decoded end_time (local time)") - julianday(t."Decoded start_time (local time)")) * 24 * 60 * 60, 0)
FROM (
SELECT
datetime(start_time/1000000-11644473600,'unixepoch','localtime') AS "Decoded start_time (local time)",
datetime(end_time/1000000-11644473600,'unixepoch','localtime') AS "Decoded end_time (local time)"
FROM downloads
) t
или с функцией strftime()
:
SELECT t.*,
strftime('%s', t."Decoded end_time (local time)") - strftime('%s', t."Decoded start_time (local time)")
FROM (
SELECT
datetime(start_time/1000000-11644473600,'unixepoch','localtime') AS "Decoded start_time (local time)",
datetime(end_time/1000000-11644473600,'unixepoch','localtime') AS "Decoded end_time (local time)"
FROM downloads
) t