node-red shows the database time difference is 8 hours

nod-red solves the inconsistency between database time and interface time (a difference of 8 hours)

msg.offline_time[i] =msg.payload[i].offline_time.toString();//This method can

Tried:
function rTime(date) { var json_date = new Date(date).toJSON(); return new Date(new Date(json_date) +8 3600 1000).toISOString().replace(/T/g, '' ).replace(/.[\d]{3}Z/,'') } //Can change the format, but it is still 8 hours less



Guess you like

Origin blog.csdn.net/weixin_43229939/article/details/114260437