Convert date to desired format

if you might have different input date formats, I recommend always using parse exact, but providing various date patterns in an input array.

var_datetime = DateTime.ParseExact(Strinput.ToString, arr_formats, System.Globalization.CultureInfo.InvariantCulture, DateTimeStyles.None)

arr_formats = {“yyyyMMdd”, “MM/dd/yyyy”, “dd/yy”}

I hope it helped you

2 Likes