Convert to date time from this format Wed Jun 19 2024 15:29:00 GMT+0200 (Central European Summer Time)

Hello,

Please help me convert this string to date format (MM/dd/yyyy HH:MM)

“Wed Jun 19 2024 15:29:00 GMT+0200 (Central European Summer Time)”

I have tried
Convert.ToDateTime(“Wed Jun 19 2024 15:29:00 GMT+0200 (Central European Summer Time)”).ToString(“MM.dd.yyyy HH:MM”)
Error:
Assign: String ‘Wed Jun 19 2024 15:29:00 GMT+0200 (Central European Summer Time)’ was not recognized as a valid DateTime.

Hi @SnehajitDas

You can use the below Expression to get the required output,

- Assign -> parsedDate = DateTime.ParseExact(inputString, "ddd MMM dd yyyy HH:mm:ss 'GMT'K", System.Globalization.CultureInfo.InvariantCulture).toString("MM.dd.yyyy HH:mm")

Check the below output for better understanding,

Hope it helps!!

Hi @SnehajitDas,

Very simple you can first remove the string from the GMT to end of the string using the “Text to Left/Right” activity, then after with that output you can easily convert your output string to a date and time format which you wants.

For your better understanding refer below image I have attached the workflow with the output.

I hope it will help for you!