The code:
var str = "91212";
DateTime.ParseExact(str, "Hmmss", System.Globalization.CultureInfo.CurrentCulture);
The error:
"91212" is not a valid DateTime
It seems c# try to use H to match 91, which is incorrect hour.
How to fix it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
H, according to MSDN, is interpreted as:so the behaviour you are seeing is as-designed and as documented.
Could you prepend
91212with a zero?