I was looking for a forum for such solutions, but could not find one that really matches my specific problem.
It may take a more experienced look to find the problem, so I appreciate all the help!
Problem: I am trying to parse a string with the date of a DateTime variable. However, even if the string date format is exactly the same, it still throws an exception.
I would like to know why and how I can solve this. I really donβt see what is wrong there!
try { string value = "Sep-17-2012 03:04:07 am"; string format = "M-dd-yyyy hh:mm:ss tt"; DateTime temp = DateTime.ParseExact(value, format, CultureInfo.InvariantCulture); } catch(Exception e){}
Thanks in advance,
Mad
source share