Convert the date (20231027) to ("mm/yyyy/dd")

I am trying to convert the date into required format
2023 -Year
10- Month
27- Day

please help me to convert the date into required format
Happy automation

can parse it into a datetime by
grafik

and return a reformatted string:

@komal.v.konduru

inputDate (String) = “20231027”
dateTimeValue (DateTime) = DateTime.ParseExact(inputDate, “yyyyMMdd”, System.Globalization.CultureInfo.InvariantCulture)
formattedDate (String) = dateTimeValue.ToString(“MM/yyyy/dd”)

Hi @komal.v.konduru

Datetimevar= DateTime.ParseExact("20231027","yyyyMMdd",System.Globalization.CultureInfo.InvariantCulture). ToString("MM/yyyy/dd")

Datetimevar is a string variable.

Hope it helps!!

Thanks everyone for you help
Happy automation!

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