Convert System.doube variable type to DateTime

Hello I am trying to convert a value from System.Double to Datetime but i am getting this error, tried few things, didnt work as expected.
image

Can someone give me the proper syntax for the same

1 Like

Hi @hansen_Lobo

Can you specify what you have to do what is your input and your expected output so that we can help you out with the syntax.

Regards

We cannot derive all details and do not know what was done. Maybe the following can help:

grafik

Well it seems like you are trying to cast a variable from the Double data type to the DateTime data type

I believe you must be converting some value from double like this 43800

If that’s the case the use this expression in assign activity

str_datetime = DateTime.FromOADate(Convert.ToDouble(Strinput.ToString)).ToString(“dd-MMM-yyyy”)

Hope this helps

Cheers @hansen_Lobo

1 Like

Hi,

Suppose you have a System.Double value, which is a Unix timestamp representing a specific date and time, and you want to convert it to a DateTime object in UiPath.

then you can Use an Assign activity: Create an Assign activity to convert the Unix timestamp to a DateTime.

For Example:
Var_DateTime = New DateTime(2023, 1, 1, 0, 0, 0, 0).AddSeconds(yourDoubleValue)

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