I'm trying to insert a DateTime value in a field which is configured as Date Only in Sharepoint list.
I've tried so far:
item["End_x0020_Date"] = Convert.ToDateTime("11/29/2017"); item["End_x0020_Date"] = DateTime.Now;
I haven't received any error but the value for dates is not stored in the list. All the other fields are filled correctly. You can see the blanks below the dates I added from Sharepoint. Any help would be appreciated.
var web = context.Web; List list = web.Lists.GetByTitle(listName); ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation(); ListItem item = list.AddItem(itemCreateInfo); item["DepartmentName"] = "IT - Networking"; item["StartDate"] = DateTime.Now.ToString(); item["EndDate"] = Convert.ToDateTime("12/10/2017");