Date conversion in Uipath

HI All,

I need to convert the date from “October‎ ‎19‎, ‎2024” to 19/10/2024.

Please help me on this.

thanks in advance.

Hi @naveen.s

Try this:

Input = "October‎ ‎19‎, ‎2024"

Output = DateTime.ParseExact(Input.Replace(",",""), "MMMM dd yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

Regards

1 Like

@naveen.s

originalDateString="October 19, 2024"
DateTime.ParseExact(originalDateString, "MMMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

1 Like

Hi @naveen.s

Try this

DateTime.Parse(Input).ToString("dd/MM/yyyy")

Regards,

1 Like

@naveen.s

please try this

DateTime.ParseExact(Input,"MMMM dd, yyyy", System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

image

cheers

1 Like

I am getting this error

Hi @naveen.s

Can you try the below

Cheers!!

1 Like

@naveen.s

You are using DateTime.ParseExact please use DateTime.Parse

DateTime.Parse(Input).ToString(“dd/MM/yyyy”)

Hie @naveen.s here how you can convert your string value to desired date time format


cheers

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