function Appendzero(obj)
{
if(obj<10) return "0" +""+ obj;
else return obj;
}
function getWeek(weeknum)
{
if(weeknum==0) week="周日";
if(weeknum==1) week="周一";
if(weeknum==2) week="周二";
if(weeknum==3) week="周三";
if(weeknum==4) week="周四";
if(weeknum==5) week="周五";
if(weeknum==6) week="周六";
return week;
}
function getDateWeek()
{
var now=new Date();
var year=now.getFullYear();//获取四位数年数
var month=now.getMonth()+1;
var date=now.getDate();
var weeknum=now.getDay();
var s=year + "-"+Appendzero(month) + "-" + Appendzero(date) + " " + getWeek(weeknum)+" ";
document.write(s);
}
getDateWeek();