Need to run a process in between 10:00 am to 3:00 pm

Hi,

I want to write a condition that needs to be run in between 10:00 am to 3:00 pm inside the sequence.
please help me on this guys.

Regards,
Suresh.

Hi @suresh_kumar4

U mean to run a process at any time in between 10 am and 3pm ?

Do it should be run in random time everytime

@NIVED_NAMBIAR, Thanks for the reply,

Yes i need to write code for that inside if condition. i don’t want to run the process. some part of code inside the workflow.

Thanks,
Suresh,

Hi @suresh_kumar4
you can try this way

  1. Try to extract the hour part only from datetime and store in a int32 variable (here i am storing in time1 variable)

  2. then compare with if condition like below

10>time1 And time1<15 (here hour part from the current time is converted to 24 hour format)

10 represent 10am while 15 represent 3pm

In this way u can do this
see the attached workflow for better understanding
Main.xaml (5.7 KB)

Hope it helps

Regards
Nived N

Happy Automation

Hi @suresh_kumar4,

If you do that, remember your license will be consumed the whole time. Are you sure this is the right approach?

if Now.ToString("HH:mm:ss") >= "10:00:00" AND Now.ToString("HH:mm:ss") <= "15:00:00"
Then:
Else:

"HH" = 24 hour format
"hh" = 12 hour format

There are many topics like this with a marked solution in the forum already (for dates). So you can just tweak them for time if needed:

1 Like

Hi @jeevith
I think it should be like this
instead of hh , it should be HH

if Now.ToString(“HH:mm:ss”) >= “10:00:00” AND Now.ToString(“HH:mm:ss”) <= “15:00:00”
Then:
Else:

Correct me if i am wrong

1 Like

Hi @NIVED_NAMBIAR

Corrected my reply above. Thank you!

1 Like

Good to know that

Well I learned something new

Like comparing datetime by string conversions

Thanks Guys!

1 Like