时间相关
获取北京时间
getBjTime(){
var stamp= new Date().getTime() + 8 * 60 * 60 * 1000;
var beijingTime = new Date(stamp).toISOString().replace(/T/, ' ').replace(/\..+/, '').substring(0, 19);
return beijingTime
},
北京时间转国际标准时间
convertToUTC(beijingTime) {
const beijingOffset = 8 * 60 * 60;
const utcTime = new Date(beijingTime.getTime() - beijingOffset * 1000);
return utcTime;
}
年月天时分秒转国际标准时间
toISOString(year, month, day, hour, minute, second) {
return new Date(year, month, day, hour, minute, second).toISOString();
},