How to compare time lies within given timeslot regardless of date

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.

For Example:

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.

1 Like

Hey,

If you have a solution please let me know

@arathi
here is an workflow cheers…!
check time period.xaml (11.1 KB)

input: start Time

  1. Start Time
  2. End Time

Output

  1. Flag

:face_with_monocle:
Aditya

2 Likes

Thanks :smiley: :smiley:

I have an alternate workflow to upload, but I cannot, since I’m a new user :frowning:

1 Like

check time period-For_Forum.xaml (10.2 KB)