I am having a really tough time exporting my data to SharePoint. All my fields are available in both SharePoint and my Dataset that is to be exported. In fact, the Data types are also the exact same. I have also taken into consideration that if my SharePoint Data type is V_W String then I don't use a String data type in my output. But it's strange that I get the error - String was not recognized as a valid DateTime
I did a quick Google search to find out. Seems that a lot of people using other tools encountered the same issue and is a typical SharePoint issue. How can I solve this?
This happens because the date value are not formatted using the ISO 8601 specifications. To avoid this error you can call the ToString() method of the DateTime class and pass the format string "yyyy-MM-ddThh:mm:ssZ" as a parameter.
A single point in time can be represented by concatenating a complete date expression, the letter "T" as a delimiter, and a valid time expression. For example, "2007-04-05T14:30". It is permitted to omit the "T" character by mutual agreement as in "200704051430". Separating date and time parts with other characters such as space is not allowed in ISO 8601, but allowed in its profile
If a time zone designator is required, it follows the combined date and time. For example, "2007-04-05T14:30Z" or "2007-04-05T12:30-02:00".
Either basic or extended formats may be used, but both date and time must use the same format. The date expression may be calendar, week, or ordinal, and must use a complete representation. The time may be represented using a specified reduced accuracy format.
I don't know whether you'd be able to get over this by formatting the date into an ISO 8601 compatible string and hoping for Sharepoint to adopt it as a datetime or not. It might be something that the Connectivity Team needs to address as part of a revision to the Sharepoint List Output tool...
You might want to reach out to email@example.com to log a ticket, there may be a workaround besides my suggestion above.
ISO 8601 is an international standard covering the worldwide exchange and communication of date and time-related data. It is maintained by the International Organization for Standardization (ISO) and was first published in 1988, with updates in 1991, 2000, 2004, and 2019, and an amendment in 2022