I have a code snippet that I can get the date and time, but the date is in the format Mês/Dia/Ano
followed by the time, but I need the format Dia/Mês/Ano
followed by the time, I already tried to change the form but it was incorrect, What I have:
Number.prototype.padLeft = function(base,chr){
var len = (String(base || 10).length - String(this).length)+1;
return len > 0? new Array(len).join(chr || '0')+this : this;
}
// Exibindo data no input ao iniciar tarefa
var d = new Date,
dformat = [ (d.getMonth()+1).padLeft(),
d.getDate().padLeft(),
d.getFullYear()
].join('-') +
' ' +
[ d.getHours().padLeft(),
d.getMinutes().padLeft(),
d.getSeconds().padLeft()
].join(':');
Note: The initial format is timestamp .