node-red显示数据库时间差8小时

nod-red解决数据库时间和界面时间不一致(相差8小时)

msg.offline_time[i] =msg.payload[i].offline_time.toString();//这个方法可以

尝试过:
function rTime(date) {
var json_date = new Date(date).toJSON();
return new Date(new Date(json_date) +836001000).toISOString().replace(/T/g, ’ ').replace(/.[\d]{3}Z/, ‘’)
}
//能转变格式,但是还是少8小时

猜你喜欢

转载自blog.csdn.net/weixin_43229939/article/details/114260437