I have a string which contains date and has a format of “MMMyy”. How would it be possible to do that?
Sample:
string date = "MAY09";
DateTime a = DateTime.Parse("MAY09"); //Gives "2012.05.09 00:00:00"
DateTime b = DateTime.ParseExact("MAY09", "MMMyy", null); //Gives error
DateTime c = Convert.ToDateTime("MAY09"); //Gives "2012.05.09 00:00:00"
I need "2009-05-01"
Specify invariant culture fore the third parameter instead of
null: