hi guys, I have date in format dd/mm/yyyy .I have to change to mm/dd/yyyy in codebehind of vb. Can anybody help to chenge the format.
+3
A:
Use DateTime.ParseExact to parse the dd/mm/yyyy format, then DateTime.ToString to convert the parsed DateTime into mm/dd/yyyy format.
itowlson
2009-04-09 07:33:01
+2
A:
Dim inDate as Date = Date.ParseExact(strDate, "dd/MM/yyyy", New System.Globalization.DateTimeFormatInfo())
Dim strOutDate as String = inDate.ToString("MM/dd/yyyy")
Console.WriteLine(outDate)
Cerebrus
2009-04-09 07:35:19