Convert to particular date time format?

In a particular column i have data as “dh!2dh13-09-2019%4ssdg”, so i want to get just 13-09-2019 part from that data and then convert it to yyyy-MMM-dd format?

Hi @Manish540

Use row(“columnname”). ToString.remove(“dh!2dh”,""). ToString.remove("%4ssdg","")

Thanks
Ashwin.S

Hi @Manish540,

Please use Regex and use like the below -

Regex.Match(Your_String_Variable,"(?=\d{2})[\d{1,2,4}-]+(?>\d{4})").Value

Hope you find your solution.

Thanks & Regards,
Apurba

“dh!2dh” these values will be not constant for all columns it will be changing?

It’s coming Regex is not accessible due to its protection level?

Try this one.

Test.xaml (8.8 KB)

1 Like

Hi @Manish540,

Check this xaml, it may help you to convert the string to datetime format you have mentioned.
GetDateString.xaml (4.9 KB)

1 Like

Hi @Manish540,

Please go to Package Manager and install System.Regex package. After that go to Import pane and import System.Regex.

Now you are ready to go.

Thanks & Regards,
Apurba

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