Hi,
I've done some simple string -> DateTime conversions before using DateTime.ParseExact(), but I have a string that I can't seem to get parsed properly. I'm probably doing something very obvious wrong but I just can't see what it is.
The code is as follows:
string date = "Tue Jun 23, 2009 2:23 pm";
DateTime lastupdate = DateTime.ParseExact(date, "ddd MMM dd, yyyy h:mm tt", null);
Running it gives a FormatException. Is my formatting string incorrect?
ps I've tried to use p.m. rather than pm in the input string but that didn't help either.