|
 <script language="javascript" type="text/javascript">
function show_time()
 {
var today,hour,second,minute,year,month,date,time;
today=new Date();
year = today.getYear();
month = today.getMonth()+1;
date = today.getDate();
hour = today.getHours();
minute =today.getMinutes();
second = today.getSeconds();
if(second < 10)
 {
time = year + "-" + month + "-" + date +" " + hour + ":" + minute + ":0" + second;
}
else
 {
time = year + "-" + month + "-" + date +" " + hour + ":" + minute + ":" + second;
}
document.getElementById("time").value = time;
}
setInterval(show_time,1000);
</script>
<input type="text" id="time" />
|