Time condition for if statement

Heyyy guys

I want to use time as my condition for 3 IF statements

For example;

If systemTime > 09:30

If systemTime > 12:30

If systemTime > 13:30

How can I achieve this?
I don’t want the condition to look at the date. ONLY time (HH:mm)

Thank you

@Suzana_Joby - you can use compareTo function like below

strTime = “10:30”

If DateTime.Now.TimeOfDay.CompareTo(strTime) = -1
“Greater Than strTime”
Else
“Less Than/Equal to strTime”
End If

2 Likes

@Suzana_Joby Can you Check this Workflow:
Time Comparison.xaml (9.4 KB)

Comparing TimeSpan type with a String might not be always helpful i guess.

2 Likes

I will check both your suggestions and get back :blush:

1 Like

@supermanPunch @GBK

Both of you are correct thanks!

I’m going to base my logic on @supermanPunch’s xaml

Thanks soooooo much guys!!!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.