How do I assign a string variable to datetime variable?

Hi All,

How do I assign a string variable to datetime variable ?

Hi @uio

You can try with this expression

DateTime.ParseExact(StringInput.ToString,"dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture)

Check out this tutorial video

Blog

Regards
Gokul

Hi @Gokul001 ,

I have an Excel input file.

Conditions :-

  1. If the “control” is “no” and the “to date” is a upcoming date, the result should be “current date”.
  2. If the “control” is “no” and the “to date” has already passed, the result should be the “to date”.
  3. If the “control” is “yes” and the “to date” has already passed, the result should be the “to date”.

The result should be like this :point_down:

image

@uio

You can do it directly using excel formula and formatting the cell as dd-MMM-yy

=IF(B2="no",IF(B1>NOW(),NOW(),B1),IF(B1>NOW(),B1,NOW()))

We you can write the formula(Write Formula/Write cell) using UiPath and also format(Format Cell Activity) the cell using UiPath…

cheers