0

I'm trying to pass a Datetime to SharePoint list. For german datetime format it works, but it needs to be variable so i tried this:

itemsList[i]["FTPDate"] = DateTime.ParseExact(entity.FTPDate.ToString("dd MMM yyyy"), "dd MMM yyyy", Culture);

but I still get an invalid data exception.

What am I doing wrong?

skeletank
  • 2,880
  • 5
  • 43
  • 75
Markus_DE_HH
  • 1,061
  • 3
  • 13
  • 29

1 Answers1

1

Sharepoint dates are saved according to ISO8061, there is a helper method on the SPUtility class that can convert your datetime to the correct string.

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.createiso8601datetimefromsystemdatetime.aspx

sjkp
  • 885
  • 6
  • 16