UiPath - Convert String to DateTime
UiPath - Convert String to DateTime |
We need to convert a string date to DateTime format very frequently whenever we are going to work with date and times.
Let’s understand and convert string to DateTime in UiPath using an example below:
Step 1 – Take a variable/argument to store the string date
in_DateString = "01/01/2020"
Assign String Date |
Step 2 – Take a variable/argument to store the string date format
in_DateStringFormat = "dd/MM/yyyy"
Assign String Date Format |
Step 3 – Convert string to datetime using below provided method
out_DateTime = DateTime.ParseExact(in_DateString,in_DateStringFormat, System.Globalization.CultureInfo.InvariantCulture)
Convert String To DateTime |
The variable/argument out_DateTime would contain the date value in DateTime format.
Comments
Post a Comment