How to convert string variable to date time

I want to know I am fetching the current date and then I want the date to fetch before 2 days so my question is how can we fetch this date again and again for dynamic flow

now() - today
now.addDays(-2) - 2 days before today

1 Like

You want to convert string variable to date using this

VariableA type is DateTime
VariableA=Convert.datetime("jan 27 2021")

Use This Code Below to take 2 days back date

VariableA=VariableA.AddDays(-2)

Regards
Chethan P


I was done this but Ui-Path studio show me this problem.

Change the Data Type of variable to System.DateTime

Assign:

yourVariable = DateTime.Parse(CurrentRow("YourColumn").ToString)
1 Like