I have string in which it has Date of type- ‘mm-dd-yyyy’;
I have to convert it into “dd-mm-yyyy”.
DateTime changedFormatDate = DateTime.ParseExact("02-27-2012", "mm-dd-yyyy", CultureInfo.GetCultureInfo("en-GB"));
but the converted value is: 27:01:2012 00:02:00
I want it to be 27-02-2012.
What is the correct sysntax please?
Note the fixed date string (got rid of the extra
2) and theMM– which meanths months: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx