To change date format in dd/mm/yyyy

Hi Team,

I am getting input date in below format and I want to change it in dd/mm/yyy format.

Wed Nov 30 2022 00:00:00 GMT+0530 (India Standard Time)

Thanks

Hi @pankajmohan.dhane

stTest = YourInputDate

DateTime.ParseExact(stTest.Split(CChar(“+”))(0),“ddd MMM dd yyyy HH:mm:ss GMT”,system.Globalization.CultureInfo.InvariantCulture).ToString(“dd/MM/yyyy”)

Best,

1 Like

HI @pankajmohan.dhane

How about this expression

DateTime.ParseExact(Split("Wed Nov 30 2022 00:00:00 GMT+0530","+")(0).TrimEnd,"ddd MMM dd yyyy HH:mm:ss GMT",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

image

Regards
Gokul

2 Likes

HI,

Can you try the following expression? This can handle time difference info correctly.

DateTime.ParseExact(System.Text.RegularExpressions.Regex.Replace(yourString," \(.*$",""),"ddd MMM dd yyyy HH:mm:ss \G\M\TK",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy")

Regards,

1 Like

thanks for solution

1 Like

Hello @pankajmohan.dhane

If you want to do it with activity instead of expression, then you can use the Modify Date activity.

Thanks

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