How do I use the date format: To parse the parameter, from time to time with the following format:
In response to the reply I have received so far, I tried the following: I still get the exception: string was not recognized as valid date time Update: The following codes work without hours and minutes : < Strike> In the sample code of your question, you forgot to capitalize all months of "M" As Anton points out, there is a need to capitalize "H" to use military time. The above code works for me I do not imagine Why can you get an error on the same code, when we are specifying the culture, can you double check your code and input? 08 February 2011 06:46
< Code> item.ServerDate = DateTime Parsexact ("08 February 2011 06:46", "DD MMM Yay HH: MM", System Glossisation. CultureInfo.Invalian Culture);
datetime. Parascact ("08 February 2011", "DD MMM yyyy", blank)
DateTime.Presquelect ("08 February 2011 06:46", "DD MMM Yay HH: MM", System Glossisation.CalcherInfo.InVariantics);
Edit
DateTime Parascact ("08 Feb 2011 13:46", "DD Mmm Yay HH: mm", System.Globalization.CalcherInfo.Invalian Culture)
Comments
Post a Comment