How convert string to date?

Hello guys,

I have problems with converting string to date. Actually I have already read all answers on the same topic and they do not solve my problem.

I have a string DateHomeOffice - this value is from table from the email
image

I want to convert it to the date.
It does not work:

What I am doing wrong? Please, help!

King regards,
Milena

1 Like

Is the string in “dd.MM.yyyy” format? That’s what you’re specifying in the example.

If you wanted to convert August 2nd, 2020 into a datetime variable, what would it look like in string format in your datatable?

Hi @Mili_1108

Place a log message after DateHomeOffice assign activity and check how your date is coming? please paste that and your requirment

Thanks

Try this for DateHomeOffice and confirm

DateHomeOffice = Convert.ToDatetime(table.Rows(1)(1).ToString).ToShortDateTimeString

Hi @Mili_1108,

May I have the string, which will be converted into date please?

Thanks & Regards,
Apurba