function cur_time() { var date = new Date(); var y = date.getFullYear(); var M = date.getMonth() + 1; var d = date.getDate(); var h = date.getHours(); var m = date.getMinutes(); var s = date.getSeconds(); var time = [y, M, d, h, m, s]; for (var i = 0; i < time.length; i++) { (time[i] < 10) && (time[i] = '0' + time[i]); $('p span').eq(i).html(time[i]); } } cur_time(); setInterval(cur_time, 1000);回复
亲,月份不对。