Are you guys, beauty?
I have a problem here, everything was working normally and nothing started to give me this problem.
Here is the function:
function atualizaHoraServidor() {
var dia = digital.getDate();
var mes = digital.getMonth();
var ano = digital.getFullYear();
var horas = digital.getHours();
var minutos = digital.getMinutes();
var segundos = digital.getSeconds();
// aumenta 1 segundo
digital.setSeconds(segundos + 1);
// acrescento zero
if (dia <= 9) dia = "0" + dia;
if (mes <= 9) mes = "0" + mes;
if (mes == 0) mes = "0" + mes;
if (horas <= 9) horas = "0" + horas;
if (minutos <= 9) minutos = "0" + minutos;
if (segundos <= 9) segundos = "0" + segundos;
dispTime = dia + "/" + mes + "/" + ano + " " + horas + ":" + minutos + ":" + segundos;
$('#horarioServidor .horarioRelogio').text(dispTime);
setTimeout("atualizaHoraServidor()", 1000); // chamo a função a cada 1 segundo
}
What happens is that it is returning the date like this:
20/000/2017 16:08:26
The day and time is right, it's only giving you trouble in the month and year. It keeps updating directly in the site, that is, it is running the seconds the ....
Does anyone know what it can be? Any function that overrides getMonth and getFullYear?
I do not know if I'm wrong, but I believe this only occurs for the month of DECEMBER, the previous month was normal.