If Else Activity: Mutliple condition not wokring


I am new to Ui Path.
I am checking if current time is between the two time slots.
Here curr_time is having value as
curr_time = DateTime.Now.ToString(“HH:mm”)

In If activity single condition like curr_time >= #11:55# is working fine. But when I am adding one more condition its returning false.

curr_time >= #11:55# and curr_time <= #17:00#

Time was 16:10 which is within the above range, but still if control is going to else part.
Please help here.


Hi @SandeepPanchal,
Welcome to the Community!
The problem is that your time is a string so it don’t know if it’s a number or time value.

Hi @SandeepPanchal,

Try this one : if hour(time) > 13 and hour(time) < 18
Credits : Stackoverflow :slight_smile:

Thanks Pablito

1 Like

Thanks Hareesh, it worked. :slight_smile: