Converting to DateTime from String

Hi!
I’m having some trouble trying to convert a string into a DateTime format,
I capture the date from the web and store into a string, running the UiPath Studio I got this result “22-09-2020 16:26:50”.
Then I try to convert it and store into a DateTime variable:


But I get this message:
“Assign: String was not recognized as a valid DateTime”
Can anyone help?

Hi @C3P0gan, welcome to forum
please check the link

hope it helps

Nived N
Happy Automation

1 Like

@c3p0gan You are converting 2 separate times. Remove the Convert.ToDateTime portion and just keep the DateTime.ParseExact instead.

1 Like

@C3P0gan

Check below post for your reference
Convert Date & Time Format Tutorial

Hope this helps you

Thanks

1 Like

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