js gets the date of the last day of the current month

js gets the date of the last day of the current month

//使用new Date(year,month,0)的方式,可以获取该月的最后一天
var end_date = new Date(2019,11,0).getDate()

code show as below:

	let end_date = new Date();
    let yy = end_date.getFullYear();
    let mm = end_date.getMonth() + 1;
    let dd = new Date(yy,mm,0).getDate();

Guess you like

Origin blog.csdn.net/qq_42208679/article/details/105254552