GetData captured date and time need to convert

Hi community,

I have a data (Wed May 25 12:45:08 MYT 2022)which has been captured from the website by using get text activity.

Now that data need to convert to this date format “01/05/2021 12:45”.

Can any one suggest how to convert this one

Hi,

Can you try the following expression?

yourString = "Wed May 25 12:45:08 MYT 2022"

Then

DateTime.ParseExact(yourString,"ddd MMM d HH:mm:ss \M\Y\T yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy HH:mm")

Regards,

I am getting this error

This is the flow i created from the get text to assign activity

Hi,

can you try to use Trim method as the following?

DateTime.ParseExact(DateAss.Trim,"ddd MMM d HH:mm:ss \M\Y\T yyyy",System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy HH:mm")

If error still occurs, can you share content of DateAss as text?

Regards,

After changing the trim i am getting the same error

DateAss = Wed May 25 21:29:17 MYT 2022

Hi,

In my environment, it works well as the following.

There might be some extra characters in your string. So can you share your data as a file using WriteTextFile activity like the following?

image

Regards,

Issue got resolved Yoichi in DateT given extra space due to that it not executed.

Thanks for your instant support

1 Like

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