I want to do a time offset, ie add or subtract the time. The problem is if the time is 24, and shift 1, the final time will be 25. The same case for if the time is 0, and shift -1, the result will be -1. How can I resolve this?
var d = new Date();
var hora_deslocamento = 2
console.log(d.getHours()+hora_deslocamento);