How to compare time lies within given timeslot regardless of date

challenge

#1

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.


#2

Hey,

If you have a solution please let me know


#3

@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


How to keep UiPath running in the background, or start automatically/scheduled time?
#4

Thanks :smiley: :smiley: