Hi!
How can we convert date entered in (dd/mm/yyyy) format into (mm/dd/yyyy) format and vice versa at runtime?
First Convert the string date to a Date Object liek this.
' This date is in (dd/mm/yyyy) format
Dim myDateObject = CDate(myDateString)
Then use the format function to convert the date format to your required (mm/dd/yyyy) format.
Dim strUSDate As String = Format(myDateObject, "MM/dd/yyyy")
Note, that i have used the capital MM as in format function lower case m means minutes.
Let me know. Read more code article on my site here
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.