How to convert date format(mm/dd/yyyy) to (dd/mm/yyyy) and also how to change string into date format

Hi @RajKumar_DC

Its working fine Thankyou

can you please help me how can i remove time in that output.

Tx
AB

Hi @absithyd ,

just add “ToShortDateString” in end

DateTime.ParseExact(("Monday, February 20th").ToString.Replace("th",Nothing),"dddd, MMMM dd",system.Globalization.CultureInfo.InvariantCulture).ToShortDateString

image

Thanks,

2 Likes

@RajKumar_DC

Thank You Its worked fine

Tx
AB

1 Like

Hi @RajKumar_DC

If i get input string 22nd or 23rd how can i replace with below expression.

could you please explain.
DateTime.ParseExact((“Monday, February 20th”).ToString.Replace(“th”,Nothing),“dddd, MMMM dd”,system.Globalization.CultureInfo.InvariantCulture)

Hi @absithyd ,

Check this

DateTime.ParseExact(("Monday, February 20th").ToString.Replace("th",Nothing).Replace(“nd”,Nothing).Replace(“rd”,Nothing),"dddd, MMMM dd",system.Globalization.CultureInfo.InvariantCulture).ToShortDateString

Thanks,

1 Like

Hi @Niket_Ghai ,

I realized that your solution only works with String dates. I have the same issue but I need to get it to be dynamic (I usually use System.DateTime.Now.ToString(xx) value). Is there a way to do it?

Thanks!