Javascript 使用SPServices UpdateListItems在SharePoint 2013中设置日期

Javascript 使用SPServices UpdateListItems在SharePoint 2013中设置日期,javascript,jquery,sharepoint,sharepoint-2013,spservices,Javascript,Jquery,Sharepoint,Sharepoint 2013,Spservices,我无法找到使用SPSServices设置SharePoint 2013列表日期的有效解决方案。对于其他列类型,我已经多次这样做了,但我无法找出日期的正确格式。以下是我正在做的: var testdate = "2016-01-01 00:00:00"; $().SPServices({ operation: "UpdateListItems", async: false, listName: "Requests", ID: 4, valuepairs: [

我无法找到使用SPSServices设置SharePoint 2013列表日期的有效解决方案。对于其他列类型,我已经多次这样做了,但我无法找出日期的正确格式。以下是我正在做的:

var testdate = "2016-01-01 00:00:00";
$().SPServices({
    operation: "UpdateListItems",
    async: false,
    listName: "Requests",
    ID: 4,
    valuepairs: [["Due Date", testdate]],
    completefunc: function (xData, Status) {
    }
});
我也尝试过这些测试值,但我的网站没有任何变化:

var testdate = "2016-1-1 0:0:0";
var testdate = "2016-01-01T00:00:00Z";
var testdate = "2016-1-1T0:0:0Z";
var testdate = "2016-01-01T00:00:00";
var testdate = "2016-1-1T0:0:0";

请让我知道是否有其他的日期格式我应该尝试,或者如果你看到任何其他错误与此代码。当我指向其中一个文本字段时,它会工作,所以我很确定这只是日期格式,它会把事情搞砸。

updateListEMS
操作要求在中提供日期字符串,例如:

var dueDateVal = new Date('2016-01-01 6:00:00').toISOString();
$().SPServices({
    operation: "UpdateListItems",
    async: false,
    listName: "Requests",
    ID: 1,
    valuepairs: [["DueDate", dueDateVal]],
    completefunc: function (xData, Status) {
         console.log('List items has been updated');
    }
});

此外,确保指定了
到期日
列的正确名称
UpdateListItems
操作需要为
valuepairs
指定一个列和值数组

如果已通过UI创建了名为
到期日
的列,则将生成
到期日
静态名称,并应按如下方式指定用于设置其值的操作:

var dueDateVal = new Date('2016-01-01 6:00:00').toISOString();
$().SPServices({
    operation: "UpdateListItems",
    async: false,
    listName: "Requests",
    ID: 1,
    valuepairs: [["Due_x0020_Date", dueDateVal]],
    completefunc: function (xData, Status) {
         console.log('List items has been updated');
    }
});
非常感谢。toISOString()正是我所需要的。我唯一需要更改的是您在new date()中输入日期的方式。这对我来说很有用:
var dueDateVal=new Date(2016,00,01).toISOString()