Change date format to dd.mm.yyyy

Hi,

I am trying to change the format of a date from “mm/dd/yyyy” to “dd.mm.yyyy”. The input variable is in string format. Is there any way how can I change the format?

Thank you very much

Tereza

Hi @Tereza_Steflova

Do like this

Assign a string variable

date1 = “02/09/2021”

then use the following

output_date=DateTime.ParseExact(date1,“mm/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture ).ToString(“dd.mm.yyyy”)

Hope it helps

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

2 Likes

Thank you very much! It works :slight_smile:

1 Like