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 on 2013-01-29 08:58  北极熊,我来了!  阅读(4464)  评论(0编辑  收藏  举报