Running a data importing tool my team had developed I ran into this little gem: “Unhandled Exception: Microsoft.SharePoint.SPInvalidPropertyException: Date Times before 1/1/1970 are not supported”.
What the hell? I’ve entered dates prior to 1970 via the UI before. A quick search showed me this great post: Proper way to set DateTime format of a Sharepoint list item datetime property. Perfect.
I have one small addition to make to that. You can use the DateTime format string of “s” for ‘sortable’ date times.
fileToUpload.Properties["DateField"] = date.ToString("s");