let date = new Date('2017-09-18T00:00:00'); // 把时间减少8小时 date.setHours(date.getHours() - 8); // 把Date对象转成ISO字符串 let isoString = date.toISOString(); // 加时间偏移 let formattedDate = isoString.replace('Z', '+08:00'); console.log(formattedDate); 