Specified cast not valid for datetime while using SAP RFC

SAP HANASAPSAP Basis

I think you better use the ParseExact method available over DateTime type. It should work.

Please find the code snippet for reference −

string dateFormat = "dd.mm.yyyy hh:mm:tt";
DateTime finalDate = DateTime.ParseExact(argumentDate, dateFormat, CultureInfo.InvariantCulture);


raja
Published on 14-Dec-2017 08:33:39
Advertisements