Error: String was not recognized as a valid DateTime


Hi all,

The cell I am trying to read is “27.07.18” - i keep getting the same error, unless I change the format to “07.27.18”

What should i do?


For full control use datetime.parseexact


First try to read this as a string, next parse this as datetime format - datetime.parseexact(…)
IF you still receive error try to replace 18 with 2018 and try again



you can use .trim in the string
you can use there


Get your date from the excel as string and convert it as date in assign activity as below

Assign to a date variable: Convert.ToDateTime(dt.Rows(0)(“YourDate”).ToString).Date

Then while feeding it in your website convert your date as below

DateTime.ParseExact(convertedDate.ToString(“MM.dd.yyyy”), “MM.dd.yyyy”, Nothing).ToString(“dd-MM-yyyy”)