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