I want to check if the current time is less than a fixed time, then perform an action. But I’m having some trouble establishing my variables to compare.
Here is what I’m trying to get:
If the current time (in format hh:mm: tt) < 12:05 PM…then perform action A. Else perform action B.
I don’t want the month/day/year, only the hh:mm: tt.
Assign your two input variables (or take them from whatever your input source is):
strNow = datetime.Now.ToString(“hh:mm”)
strFixed = “00:55”
where the latter is your fixed time.
Then you make an if with the following condition:
“datetime.ParseExact(strNow, “hh:mm”, system.Globalization.CultureInfo.InvariantCulture) < datetime.ParseExact(strFixed, “hh:mm”, system.Globalization.CultureInfo.InvariantCulture)”
I’ve attached the workflow for you. Have a good day