tags:

views:

76

answers:

2

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
+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