You can change below:
if you want replace "31/12/2005" with "12/31/2005", you can see below code:
DateTime d1 = DateTime.ToDate;
string dd = d1.Day.ToString();
string mm = d1.Month.ToString();
string yyyy = d1.Year.ToString();
string d2 = dd + "/" + mm + "/" + yyyy;
***************************************
another way :
DateTime.Today.ToString("dd-MMM-yyyy");
yourDate.toString("yyyy-MMM-dd hh:mm:ss");
DateTime.ParseExact("04/09/2013 8:09:10 PM","dd/MM/yyyy h:mm:ss tt", CultureInfo.InvariantCulture);
string result = dt.ToString("MM-dd-yyyy", CultureInfo.InvariantCulture);
if you want replace "31/12/2005" with "12/31/2005", you can see below code:
DateTime d1 = DateTime.ToDate;
string dd = d1.Day.ToString();
string mm = d1.Month.ToString();
string yyyy = d1.Year.ToString();
string d2 = dd + "/" + mm + "/" + yyyy;
***************************************
another way :
DateTime.Today.ToString("dd-MMM-yyyy");
yourDate.toString("yyyy-MMM-dd hh:mm:ss");
DateTime.ParseExact("04/09/2013 8:09:10 PM","dd/MM/yyyy h:mm:ss tt", CultureInfo.InvariantCulture);
string result = dt.ToString("MM-dd-yyyy", CultureInfo.InvariantCulture);