Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Google API开始和结束时间格式issue Node.JS_Javascript_Node.js_Date_Google Api_Google Calendar Api - Fatal编程技术网

Javascript Google API开始和结束时间格式issue Node.JS

Javascript Google API开始和结束时间格式issue Node.JS,javascript,node.js,date,google-api,google-calendar-api,Javascript,Node.js,Date,Google Api,Google Calendar Api,在Node.js中使用包含Google日历事件创建数据的变量时遇到问题。我为此尝试了许多不同的时间格式,但我收到了奇怪的错误。我试图声明一个变量,该变量与有效变量相同,但仍然出现错误 //这些变量起作用 const eventStartTime=新日期(); eventStartTime.setDate(eventStartTime.getDay()+2); const eventEndTime=新日期(); setDate(eventEndTime.getDay()+2); setMinut

在Node.js中使用包含Google日历事件创建数据的变量时遇到问题。我为此尝试了许多不同的时间格式,但我收到了奇怪的错误。我试图声明一个变量,该变量与有效变量相同,但仍然出现错误

//这些变量起作用
const eventStartTime=新日期();
eventStartTime.setDate(eventStartTime.getDay()+2);
const eventEndTime=新日期();
setDate(eventEndTime.getDay()+2);
setMinutes(eventEndTime.getMinutes()+45);
//这些变量给出了一个“错误请求错误”,尽管它们与console.logged时的前两个变量相同
让eventStart=calendarLesson.date+“”+calendarLesson.startTime+“:00 GMT+0100(中欧标准时间)”;
让eventEnd=calendarLesson.date+“”+calendarLesson.endTime+“:00 GMT+0100(中欧标准时间)”;
//我还尝试设置开始和结束时间变量,例如let testTime=“2020-07-12T09:30:00.0z”,这在查询执行中没有给出任何问题
常量事件={
总结:“教训”,
地点:“教室”,
描述:“这是一个教训”,
开始:{
日期时间:eventStart,
时区:“CET”
},
完:{
日期时间:eventEnd,
时区:“CET”
},
与会者:[{
“电子邮件”:日历电子邮件地址
}],
提醒:{
//提醒
},
}
根据,以下是可接受的日期和日期时间格式:

日期:

日期,格式为“yyyy-mm-dd”

日期时间:

时间,作为组合日期时间值(根据格式)。除非在时区中明确指定了时区,否则需要时区偏移


1985-04-12T23:20:50.52Z

1996-12-19T16:39:57-08:00


请删除日期时间字符串中的
(中欧标准时间)
。我尝试在在线javascript编译器上运行您的代码片段,但收到了不同的输出