Fuel consumption over a period

I’m doing data logging on vehicles. I’m looking to calculate the amount of fuel burned over a day/selected period.
The average consumption gets logged multiple times every second (in L/h)
I basically need to multiply the average by the total time.

How would I get the time period only where data is logged?

Ideally, I would have a graph of fuel consumption per day, or a stat of total fuel consumption over the period. The hard part is fetching only the period where data is logged.