I'am struggling on how to make this on code. please help. I use c#
Here's the data:
DateTime date_from = Convert.ToDateTime("2018/08/22 12:20:00");
DateTime date_to = Convert.ToDateTime("2018/08/28 07:25:00");
DateTime other_date_from = Convert.ToDateTime("2018/08/24 00:20:00");
DateTime other_date_to= Convert.ToDateTime("2018/08/25 00:21:00");
Now, I'd like to check if the data from date_from
and date_to
is within the range of other_date_from
and other_date_to
.
For example.
This datetime
"2018/08/22 12:20:00 to 2018/08/28 07:25:00" : August 22 12:20 PM to August 28 07:25 AM
is within the range of
"2018/08/24 00:20:00 to 2018/08/25 00:21:00" August 24 12:20 AM to August 25 12:21 AM
If its within the range, it returns true, if not return false.