SQLite Forum

Time difference between two records
Login
Yes.

Join the table to itself to find the time of the next event.

For the last record, replace the NULL result with the start of the next year. See datetime() function documentation.

To compute the time difference, use the strftime() function documented on the same page.