How to convert string to date format

sure you can use a variable instead of the hard coded string from the prototype snippet

DateTime.ParseExact(YourStringVar,"dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture).tostring("MM/dd/yyyy")

with the usage of ToString we do know that a string is returned