Category: datetime

To convert from dd/mm/yyyy to mm/dd/yyyy

I used the following code. string result = DateTime.ParseExact(“24/5/2009 3:40:00 AM”, “d/M/yyyy h:mm”, CultureInfo.InvariantCulture) .ToString(“M/d/yyyy h:mm”); In my textbox time after 12’0 Clock( for eg:24/5/2009 14:00 ) i want to convert to format as 24/5/2009 2:00 PM.Can anybody give appropriate code?