Convert date from dd/MM/yyyy to dd/MMM/yyyy

Hey there.
I’m asked to convert the date format for cells in excel sheet as said below
[ And in the birthdate panel should be entered with the formatting ex: “12-Mar-1994”]
plz help bcz I tried all solutions here but it didn’t work

@Mohammad_Allan
Sequence
|-- Assign activity(to get the input date in the format dd/MM/yyyy)
|-- Assign (YourInputDate = DateTime.ParseExact(YourInputDate, “dd/MM/yyyy”, CultureInfo.InvariantCulture).ToString(“dd/MMM/yyyy”))
|-- Message Box (or any other activity to display or use the result)

Hi @Mohammad_Allan

DateTime.ParseExact(Input.toString,"dd/MM/yyyy",System.globalization.Cultureinfo.InvariantCulture).toString("dd-MMM-yyyy")

Check the below workflow for better understanding,

If above one not works, then elaborate your query with Input and output then it will be better for us to understand.

Hope it helps!!

1 Like

@Mohammad_Allan

DateTime.ParseExact(input,"Your date Format",System.Globalization.CultureInfo.InvariantCulture).ToString("dd-MMM-yyyy")
1 Like

Hi @Mohammad_Allan

Try this

DateTime.ParseExact(InputDate,{"dd/MM/yyyy","dd-MM-yyyy"},System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None).ToString("dd/MMM/yyyy")

1 Like

@Mohammad_Allan

use for each row in datatable activity, inside use that use assign activity and try the below expression

DateTime.ParseExact(Input.toString,"dd/MM/yyyy",System.globalization.Cultureinfo.InvariantCulture).toString("dd-MMM-yyyy")
1 Like

yes it worked
thanks

1 Like

It’s my pleasure,

Happy Automation!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.