Amol88 Amol88 - 5 months ago 70x Question

How to convert string date (25.04.2016) to date format (mm/dd/yyyy) in

I have string date (25.05.2016) ,i want to convert it into (mm/dd/yyyy) format in
Please suggest solution.


Use ParseExact with the format you need to get the string into a date variable, then .ToString to convert to another format:

Dim dateString As String = "25.05.2016"
Dim dateFormat As String = "dd.MM.yyyy"
Dim dateValue = DateTime.ParseExact(dateString, dateFormat, CultureInfo.InvariantCulture)


The list of custom datetime formats can be found here