发现网上用js获取某月最后一个的方式大多比较复杂,上个简单的: new Date(2013,4).toJSON().substring(0,10) new Date(2013,4,0).toLocaleFormat('%Y-%m-%d') 显示"2013-04-30". year+'-'+month+'-'+new Date(year,month,0).getDate();//获取当月最后一天日期 OK. 另外,前两种方法貌似IE上兼容性有问题,自己看着用吧
package huolongluo.family.util; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; /** * Created by 火龙裸 on 2018/7/13. */ public class Number_Of_Days { /** * 获取当月的 天数 */ public static int getCurrentMonthDay() { Calend