var date=new Date()//显示当前电脑的日期
var d=new Date(2012,10,1);// 定义一个日期。
<script type="text/javascript">
var mydate=new Date();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var mynum=mydate.getDay();
document.write(mydate.getDay());
document.write(weekday[mynum])
</script>