A DateTime
value doesn't have a format at all, so if the source is a datetime value it's not actually a conversion but a just matter of formatting the output.
You can use the custom foratting string "M'/'d'/'yyyy h':'mm':'ss tt"
to get exactly that format. (Your question mentions two different formats, so I assume that it's the one represented by the example data that you want; the one that has seconds.)
Example:
Dim result As String = source.ToString("M'/'d'/'yyyy h':'mm':'ss tt")
If the source is a string so that it's actually a conversion that you need, you can either use string operations to chop up the string into components and rearrange them, or you can parse the string into a DateTime
value and reformat it into a new string.
Example:
Dim source As String = "24/5/2009 3:40:00 AM"
Dim d As DateTime = DateTime.ParseExact(source, "d'/'M'/'yyyy h':'mm':'ss tt", CultureInfo.InvariantCulture)
Dim result As String = d.ToString("M'/'d'/'yyyy h':'mm':'ss tt")
Or:
Dim source As String = "24/5/2009 3:40:00 AM"
Dim d As String() = source.Split("/".ToCharArray(), 3)
string result = d(1) + "/" + d(0) + "/" + d(2)