您的位置:首页 > Web前端 > JavaScript

js获取当月有多少天 当朋最后一天是周几

2017-06-15 13:56 411 查看
var oDate = new Date() 或后台传的字符串对象时间转换的时间对象

function get_month_date(oDate){
oDate.setMonth(oDate.getMonth());
oDate.setMonth(oDate.getMonth() + 1);
oDate.setDate(1);
oDate.setMonth(oDate.getMonth());
oDate.setDate(0);
return oDate.getDate();
}

function get_last_date_week(oDate){
oDate.setMonth(oDate.getMonth());
oDate.setMonth(oDate.getMonth() + 1);
oDate.setDate(1);
oDate.setMonth(oDate.getMonth());
oDate.setDate(0);
return oDate.getDay();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: