SQLite Forum

Calculating duration in ISO8601 timestamp
Login
All fixed! The app generating the data now uses a decimal instead of a colon!

```
select
	start,
	end,
	duration
from (
	select
		min(datetime) as start,
		max(datetime) as end,
		julianday(max(`datetime`)) - julianday(min(`datetime`)) as duration
from table1
);
```

```
┌─────────────────────────┬─────────────────────────┬─────────────────┐
│          start          │           end           │    duration     │
├─────────────────────────┼─────────────────────────┼─────────────────┤
│ 2021-07-19 08:43:46.956 │ 2021-07-20 15:18:26.623 │ 1.2740702200681 │
└─────────────────────────┴─────────────────────────┴─────────────────┘
```

Thanks for the time and education!