function func(){ var da=new Date(); var myYear=da.getFullYear(); var myMonth=("0"+(da.getMonth()+1)).slice(-2); var myDay=("0"+da.getDate()).slice(-2); var myHour=da.getHours(); var myMinutes=da.getMinutes(); var mySeconds=da.getSeconds(); var myMilliseconds=da.getMilliseconds(); var dateTime=myYear+"-"+myMonth+"-"+myDay+"-"+myHour+":"+myMinutes+":"+mySeconds+":"+myMilliseconds; var time=document.getElementById("date1"); time.innerHTML=dateTime; }
添加回答
举报
0/150
提交
取消