My parser may encounter \"2:37PM\" (parsed by \"H:mma\") or \"02:37PM\" (parsed by \"hh:mma\"). How can I parse both without resorting to a try-catch?
I receive an erro
You can create a string for the hours and have an if statement to check whether the hours is < 10 (single digit) then prepend "0".