var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var dateStr = *你所需要转换的时间* //格式为("2008-08-08 08:08:08";)
var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/")));
alert(weekDay[myDate.getDay()]);
var weekDay = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
var dateStr = *你所需要转换的时间* //格式为("2008-08-08 08:08:08";)
var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/")));
alert(weekDay[myDate.getDay()]);
本文标题: js 日期字符串转换成日期类型,格式化为周期
本文链接:https://www.haomeiwen.com/subject/lhabhxtx.html
网友评论