var year = new new a Date () getFullYear ();. var month The = new new a Date () getMonth ();. var nowDate = new new a Date (year, month The, 0 ); // last parameter is 0, which means acquiring 2018 October total number of days var lastDay = nowDate.getDate (); // 31
Reproduced in: https: //www.cnblogs.com/hzx-5/p/11045519.html