Q: converting string date to dd.MM.yyyy format I am working on vb.net application  
am getting date like this :
recevdate = rs("ITIReceiveddate")

my recevdate format is like this : 2/27/2016 month/date/year
i want to convert like this : date.month.year  27.2.2016 
so i wrote code like this :
 Dim dt as string = DateTime.ParseExact(recevdate, "dd.MM.yyyy", Nothing) 

but its getting error ..
What is wrong with my code? how i can rectify this issue?
any help is very appreciable..Thanks

A: DateTime.ParseExact returns a DateTime, not a string. Your project is setup with the Option Strict set to Off and this enables this kind of automatic conversions. But it is, as usual, a trap waiting to kick on unsuspecting programmers.
To execute correctly you need 
Dim recevdate = "2/27/2016"


Dim dt As DateTIme = DateTime.ParseExact(recevdate, "M/d/yyyy", Nothing)
Dim formattedString = dt.ToString("d.M.yyyy")
Console.WriteLine(formattedString)

Notice that you have an error also in your formatted mask for parsing the date. If your date has only one digit for months or one digit for days then you need just one M and one d both on the parsing and in the formatting back to string
