I am having difficulties seeing "how much" of 2 DateTime's are between 2 other date times.
For instance, i have a "start" and "end" datetime (i omit the day, seeing as only the time is relevant here):
Start: 01:00
End: 09:30
And i have 2 other times:
Night_start: 00:00
Night_end: 04:00
So, i need to figure out "how much" of the "start" and "end" are between the "night_start" and "night_end" part.
The correct answer is obviously 3 hours, but how would i go about calculating this?
Hope my question makes sense. thanks.