I have received two types of date format in excel MM/dd/yyyy and dd/MM/yyyy.
I want the output should be MM/dd/yy
I tried the below code but got error - “value of 1-dimensional arry to string can’t be converted to string”.
It is not advised to use these two formats at once as the dates might be read wrong…please try correcting from input
DateTime.ParseExact(“12/06/2023”, {“dd/MM/yyyy”,“MM/dd/yyyy”}, System.Globalization.CultureInfo.InvariantCulture,DateTimestyles.None).ToString(“MM/dd/yy”) is the correct way…but as specified usingb these two formats together is not advised