Learn From:http://blog.csdn.net/sunhuwh/article/details/39161323 public class CalendarTest { public static void main(String[] args) { // 获取当前年份.月份.日期 Calendar cale = null; cale = Calendar.getInstance(); int year = cale.get(Calendar.YEAR); int month =…
public class CalendarTest { public static void main(String[] args) { // 获取当前年份.月份.日期 Calendar cale = null; cale = Calendar.getInstance(); int year = cale.get(Calendar.YEAR); int month = cale.get(Calendar.MONTH) + 1; int day = cale.get(Calendar.DATE);…
欢迎加入前端交流群交流知识&&获取视频资料:749539640 let today = new Date().getTime() let lastDay = getTimeByDay() //获取30天后的日期 let lastTime = formatTime(lastDay) console.log(lastTime);//2019-03-23 /* num 获取当天多少天后的日期 */ function getTimeByDay(num) { * * * * num; } funct…
function p(s) { return s < 10 ? '0' + s: s;}getlastmonth() function getlastmonth() { var myDate = new Date(); var currentYear=myDate.getFullYear(); var currentMonth=myDate.getMonth()+1; var lastMonth=myDate.getMonth(); var cur…