The follow *should* work for you but I'm not sure how it handles
globalization as I'm doing this from memory.
===============
using System.Globalization;
....
....
DateTimeFormatInfo formatInfo = new DateTimeFormatInfo();
formatInfo.AMDesignator = "am";
string input = "8/09/05 9:27a";
string format = "M/dd/yy h:mmt";
DateTime.ParseExact(input, format, formatInfo)
===============
Hope this helps.
Brian Delahunty
Ireland
http://briandela.com/blog
"ra*********@gmail.com" wrote:
I'm trying to get the following date/time string formatted. But I don't
succeed. I get an exception saying the date/time string is invalid.
string input = "8/09/05 9:27a";
string format = "M/dd/yy h:mmt";
DateTime.ParseExact(input, format, null);
What am I doing wrong here? The following parse works ok.
string input = "9-08-05 9:27";
string format = "d-MM-yy H:mm";