Hi. I have a string with the format “22/02/2019 - 07:24 PM”.
For which I’m using the format “dd/MM/yyyy - HH:mm tt”
But it throws “string not recognized as valid datetime” when I try to convert that string into a datetime, like this:
Datetime.ParseExact(myString, “dd/MM/yyyy - HH:mm tt”, System.Globalization.CultureInfo.InvariantCulture)
I know for a fact that the “AM/PM” are the ones causing the problem, because if I don’t use them, the parse works.
But I do need the “AM/PM” becase I need to be able to differentiate the hour, which goes from 1 to 12 AM/PM. Is there a way to solve this problem?.