How do I use DateTime.Parse to parse a datetime with the following format:
08 Feb 2011 06:46
In response to the answer I've received so far, I tried the following:
item.ServerDate = DateTime.ParseExact
("08 Feb 2011 06:46", "dd MMM yyyy hh:mm", System.Globalization.CultureInfo.InvariantCulture);
I still get the exception: String was not recognized as a valid DateTime.
UPDATE: The following code works without the hour and minute:
DateTime.ParseExact("08 Feb 2011","dd MMM yyyy",null)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…