Typical input formats are 10 Dec 2019, 10 DEC 2019, 10 December 2019, 10 DECEMBER 2019, 10 jun 2019, 10 june 2019
i want to convert them to
12/10/2019, 12/10/2019 , 12/10/2019, 12/10/2019, 6/10/2019, 6/10/2019
Typical input formats are 10 Dec 2019, 10 DEC 2019, 10 December 2019, 10 DECEMBER 2019, 10 jun 2019, 10 june 2019
i want to convert them to
12/10/2019, 12/10/2019 , 12/10/2019, 12/10/2019, 6/10/2019, 6/10/2019
Try this @Gaurav_Bahuguna
cDate(" your input date format").toString(“expected date format”)
It is very easy!!!
Follow the below steps:-
string Array formats = {“dd MMM yyyy”,“dd MMMM yyyy”}
string Array inputSamples = {“10 Dec 2019”, “10 DEC 2019”, “10 December 2019”, “10 DECEMBER 2019”, “10 jun 2019”, “10 june 2019”}
for each item in (inputSamples)
{
DateTime OutPutSamples = Date.ParseExact(item.ToLower,formats,System.Globalization.DateTimeFormatInfo.InvariantInfo, Globalization.DateTimeStyles.None)
message box → OutPutSamples
}
I tested it from my side.
Please help yourself by using this. Mark this as solution if it helps you.
Thanks and Regards,
@hacky
Try this
Convert.ToDateTime(“10 Dec 2019”).ToString(“MM/dd/yyyy”)
Thanks
Did you tried any of the below mentioned solutions ? If yes then are you able to resolve this query ?