Hello dear people!

I would like to ask your help with the following problem.

I want to check if a time range as example below is within another time range, this also needs to pass midnight as you can see.

Example 1:

A B C Result
15:00-16:00 08:00-16:00 1
16:00-17:00 08:00-16:00 0
17:00-18:00 08:00-16:00 0

Example 2:

A B C Result
15:00-16:00 17:00-01:00 0
16:00-17:00 17:00-01:00 0
17:00-18:00 17:00-01:00 1

I appreciate your help!