function getDate(){
var today,hour,second,minute,year,month,date;
today = new Date();
year = today.getFullYear();
month = today.getMonth()+1;
date = today.getDate();
hour = today.getHours();
minute =today.getMinutes();
second = today.getSeconds();
if(month<10) month="0"+month;
if(date<10) date="0"+date;
if(hour<10) hour="0"+hour;
if(minute<10) minute="0"+minute;
if(second<10) second="0"+second;
alert( year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second); //显示时间
}