Hi, thank you for the suggestion. If a different input example was given without any date and just the time say for example an input string will be “17:00 PM”. Is it possible to be able to still use this time alone without any date and in this format and if its within the time range as shown above?
I have tried using DateTime.ParseExact(TestString, “hh:mm”, Globalization.CultureInfo.InvariantCulture)
From the input “17:30 PM” - I dropped the PM so used the above command without the tt inside the input string because it is already in a 24hour format. I kept receiving the error “Assign: String was not recognized as a valid DateTime.”
Is there a correct command I could be able to use using the 24 hour format for this original question?
Thank you - there will be no dates included as is just the time. That suggestion worked but unable to use it for the last part in the if statement where it then checks if the time is within the time range or not because it is in a string
Yes that is right but then with this time input I need to check if it is within a time period -
For example an input is “17:00 PM” and I need to check if this time is within say 10:00 AM and 2:00 PM
So it would be put into an if else activity statement where it checks if 17:00 PM is within the time period or outside the time period. In one of the suggestions above it has a command in the if condition but because the input value is in a string type not datetime type so unable to use this input inside the if condition if that makes sense?