I want to check whether current time lies between given time slot regardless of date.
I have a service that user can configure to run during “off-peak” hours. They have the ability to set the time frame that the service can run.
User A works 8am-5pm, so they want to schedule the app to run between 5:30pm and 7:30am.
User B works 9pm-6am, so they schedule the app to run between 6:30am and 8:30 pm.
The point is that the app uses their computer while they are not.
Given a DateTime of the current time, a DateTime of the start and a DateTime of the stop time, how can I check if current is between start and stop.
The tricky part for me is that the time can cross the midnight boundary.