Convert string to date time

to point is i already have a string which become a dateTime.

at the end what i want is to write the date on a excel sheet and make this cell be able to be filtred with the other date present in the file when i filter by the most recent.

at this moment the other date have been written manually and now i want it to do it with a robot. the cell format is date type but not the column. i can’t change the type.
that’s why i wanted the new date to be dateTime type

Does it only accept MM/dd/yy or MM/dd/yyyy?
Therefore, 10/03/19 works but 13/03/19 doesn’t work because there is no 13th month?

1 Like

Hi @grish,

Please try with the below -

Hope it will help you.

Thanks & Regards,
Apurba

1 Like

hi @grish ,
when converting a string to a datetime it comes with, say, “dd/MM/yyyy hh:mm:ss”". In order to obtain just the actual date you could simply use split methods:

thus, if date = “dd/MM/yyyy hh:mm:ss”
date.Split(" "c)(0) will solve the issue, returning a list of two elements, the first being the left side of the space " ", the second being the right side.

cheeeeers, Maurizio

2 Likes

What’s the best way to convert “13 Nov 2019 3:37:25 PM CST” to datetime ?

Thanks!

reading value and storing it to UiPath.core.genericValue will solve the issue

@grish

Have you find the solution for this?