js 日期字符串转换成日期类型,判断星期几

  var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
        var dateStr = "2008-08-08 08:08:08";
        var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/")));
        alert(weekDay[myDate.getDay()]);
posted @ 2011-09-29 17:43  晓风拂月  阅读(660)  评论(0编辑  收藏  举报