// 获取系统时间
var day = new Date(); var Year = 0; var Month = 0; var Day = 0; var currentDate = ""; Year= day.getFullYear(); Month= day.getMonth()+1; Day = day.getDate(); currentDate += Year; if (Month >= 10 ){ currentDate += "-" + Month; } else { currentDate += "-" + "0" + Month; } if (Day >= 10 ){ currentDate += "-" + Day ; } else { currentDate += "-" + "0" + Day ; } // 星期 var dayNames = new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); currentDate += " " + dayNames[day.getDay()]; $("#top_date").html(currentDate);