I need transform this input string june 2014
in 2014-06
output date and I tried this solution:
DateTime dt;
DateTime.TryParseExact(Input.ToString(), "MMM yyyy",
CultureInfo.InvariantCulture, DateTimeStyles.None, out dt);
Response.Write(dt.ToString("yyyy MMM"));
But in output I have 0001 jan
, why?
I would greatly appreciate any help you can give me in working this problem.
Thank you in advance.