How to convert into date form string

Hi Team

Convert my input string format to date format

Input : 26th of September, 2024

Output : Sep 26, 2024

thanks
shaik

Hi @shaik.muktharvalli1

Try this way,

variable string Inputdate = "26th of September, 2024"

variable string Inputdate = Inputdate.Replace("th","").Replace("st", "").Replace("nd", "").Replace("rd", "").Replace(" of","")

variable datetime Output = DateTime.ParseExact(Inputdate.ToString.Trim,"dd MMMM, yyyy",System.Globalization.CultureInfo.InvariantCulture)

Output.ToString(“MMM dd, yyyy”)Sep 26, 2024

image

Regards,
Gowtham K

Thank you @Gowtham_K115

Regards
Shaik

1 Like

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