Arithmetic operation [2362] error on one node-red but not other

The editor complains because

var temp = context.get("last_update") || new Date();
var current = new Date();

At this point current is a Date object

if (temp!==undefined) {
    current = current.getTime() - temp.getTime();
    current = Math.floor(current/1000);

And here you are assigning an integer value to it (the difference in milliseconds)

If you were to change it to this it might work (not tested)

var temp = context.get("last_update") || new Date();
var current = new Date();

if (temp!==undefined) {
    var diff = current.getTime() - temp.getTime();
    diff = Math.floor(diff/1000);
    msg.secsincelast = diff;
    var minute = Math.floor(diff/60);
    var hour = Math.floor(minute/60);
    var day = Math.floor(hour/24);
    if (diff>=24*60*60) {
        msg.lastupdate = "Last update " + day + " days, " + hour%24 + " hours, " + minute%60 + " minutes, " + diff%60 + " seconds ago";
    } else if (diff>=60*60) {
        msg.lastupdate = "Last update " + hour%24 + " hours, " + minute%60 + " minutes, " + diff%60 + " seconds ago";
    } else if (diff>=60) {
        msg.lastupdate = "Last update " + minute%60 + " minutes, " + diff%60 + " seconds ago";
    } else {
        msg.lastupdate = "Last update " + diff%60 + " seconds ago";
    }
}