La data non si aggiorna automaticamente
Questo codice stampa la data, ma quando è mezzanotte non stampa il giorno successivo, per fare ciò devo aggiornare la pagina
Codice PHP:
//Data italiana
function data() {
var now = new Date();
var giornosett = now.getDay();
var giorno = now.getDate();
var mese = now.getMonth();
var anno = now.getFullYear();
var nameMth = new Array('gen','feb','mar','apr','mag','giu','lug','ago', 'set','ott','nov’,‘dic');
setTimeout(function() {
startTime()
},1000);
document.getElementById('data').innerHTML = giorno + ' ' + nameMth[mese] + ' ' + anno;
}
<body onload="data()">
<span id="data"></span>