<script>
//获取当月总共天数函数
function getMonDay(mydate) {
var d = new Date(mydate);
//d.getMonth()+1月份索引从0开始,天数索引从1开始,第0天即代表最后一天
var allDays = new Date(d.getFullYear(), (d.getMonth() + 1), 0).getDate();
return allDays;
}
//获取当前是当月的第几天
function getNowDay(mydate) {
var d = new Date(mydate);
return d.getDate();
}
//获取当前年份
function getNowYear(mydate) {
var mydate = new Date(mydate);
return mydate.getFullYear();
}
//获取当前月份
function getNowMonth(mydate) {
var mydate = new Date(mydate);
return (mydate.getMonth() + 1);
}
</script>