// 往前数monthNum月份,不能往后数monthNum getPreMonthDay("2018-12-28",20) // 往前数monthNum月份,不能往后数monthNum getPreMonthDay: function(date, monthNum) { let dateArr = date.split('-') let year = dateArr[0] //获取当前日期的年份 let month = dateArr[1] //获取当前日期的月份 let day =…
function fun_date(aa){ var date1 = new Date(), time1=date1.getFullYear()+"-"+(date1.getMonth()+1)+"-"+date1.getDate();//time1表示当前时间 var date2 = new Date(date1); date2.setDate(date1.getDate()+aa); var time2 = date2.getFullYear()+"-…
# -*- coding: utf-8 -*- '''获取当前日期前后N天或N月的日期''' from time import strftime, localtime from datetime import timedelta, date import calendar year = strftime("%Y",localtime()) mon = strftime("%m",localtime()) day = strftime("%d",l…
# -*- coding: utf- -*- '''获取当前日期前后N天或N月的日期''' from time import strftime, localtime from datetime import timedelta, date import calendar year = strftime("%Y",localtime()) mon = strftime("%m",localtime()) day = strftime("%d",lo…