Greeting everybody. I need to read a datatable that comes from a website and get the text from a specfic column. That cell contains the date in the format “MM/dd/yy” which I will compare to today’s date to get the time frame. The problem is that I’m receiving an error “String was not recognized as a valid DateTime”. How to assign a string in “MM/dd/yy” to a DateTime variable? Thanks.
- stringvariable = Split(CurrentRow.Item(“Column”).ToString," ")(0) → get the content from the cell
- datetimevariable = DateTime.ParseExact(stringvariable,“MM/dd/YY”,System.Globalization.CultureInfo.InvariantCulture) → convert to datetime → returning error, I have tried lots of combination for the date format