Strong parsing of a string to Date in MM/dd/yyyy format

HI @Aakash_Singh_Rawat

You can try with strong Date Parsing

DateTime.ParseExact("Jan 01, 2022",{"MMM dd, yyyy","MMM d, yyyy","dd/MM/yyyy","MM/dd/yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("MM/dd/yyyy")

Output

image

Regards
Gokul

1 Like