Problem with String to Datetime [String was not recognized as a valid DateTime.]

If I read from Cell:“B2” it can run without problem, so I dont know why when I read in Cell:“D2” it will be error String was not recognized as a valid DateTime.

B2 and D2 were write by same activity value as Now.ToString but not same day.
In%20excel%20file

When read Cell B2 it worked.
worked

When read Cell D2 had error.

Anyone has suggestion or/and concerns please help me.
Thank you.

Can you please print and see the D2 cell value (Datetest) once and check what it is printing.

I was read D2 cell and use write line print datetest it was below this.

Got it.
Your time format is in 24 HOUR format.
Please use HH:mm:ss instead of hh:mm:ss in the parsing.

Regards,
Karthik Byggari

5 Likes

It worked.
Thank you so much. @KarthikByggari
:grinning:

1 Like

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