Hello Team,
I have situation where I have downloaded from a customer portal and the date that is showing in the excel format is DD-MM-YY
When I extracted the data in Read range then the date shown is in
DataRow { HasErrors=false, ItemArray=object[3] { “91295942”, “5003213532”, [03/22/2021 00:00:00] }, RowError="", RowState=Added, Table=[DataTable] }
I was converting from DD-MM-YYYY to MM-DD-YYYY as per the excel sheet column and this is the parse command I had written.
datetime.ParseExact(row.item(2).ToString,“MM-dd-yyyy hh:m:ss”,system.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)
If I don’t add the .ToString then I get an error.
option strict on disallows implicit conversions from ‘object’ to 'string’
else
Message Box: String was not recognized as a valid DateTime.
Need your helping hand.
Regards,
Manjesh
5 posts - 3 participants