js通过日期计算属于星期几

 var arys1 = new Array();
    arys1 = "2016-09-25".split('-');     //日期为输入日期,格式为 2013-3-10
    var ssdate = new Date(arys1[0], parseInt(arys1[1] - 1), arys1[2]);
    var  week1=String(ssdate.getDay()).replace("0","日").replace("1","一").replace("2","二").replace("3","三").replace("4","四").replace("5","五").replace("6","六")//就是你要的星期几
    var week="星期"+week1; //就是你要的星期几

 


                                    
posted @ 2016-09-23 15:34  webnote  阅读(7113)  评论(0编辑  收藏  举报