/** * 优惠券有效期 * startDate:起始日期 * valueTime:有效天数 */ function transferCouponValueTime(startDate,valueTime){ var date = new Date(startDate); var newDate = new Date(date.getFullYear(),date.getMonth(),date.getDate()+valueTime); var year1 = date.getFullYear…
<script type="text/javascript"> getMonthBetween("2015-05-01","2016-05-01") function getMonthBetween(start,end){ var d1 = new Date(start); var d2 = new Date(end); var month1 = d1.getMonth() + 1,month2 = d2.getMonth() + 1…
月份0---11 var date = new Date(year,fenye_arr[0]-1,fenye_arr[1]); miao=date.getTime(); var _year=new Date(miao-j*24*3600*1000).getFullYear(); var _yue=new Date(miao-j*24*3600*1000).getMonth()+1; var _ri=new Date…
代码: //判断是否超期(有效期开始超过一年后算已超期) function IsEffect(effectDate) { var val = ""; var currentDate = new Date(); var year = currentDate.getFullYear() - 1;//当前年-1 var month = currentDate.getMonth()+1;//月份是从0索引的,所以要+1 var day = currentDate.getDate();//获取当…
var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份(4位,1970-????)myDate.getMonth(); //获取当前月份(0-11,0代表1月)myDate.getDate(); //获取当前日(1-31)myDate.getDay(); //获取当前星期X(0-6,0代表星期天)myDate.getTi…
var myDate = new Date();myDate.getYear(); //获取当前年份(2位)myDate.getFullYear(); //获取完整的年份(4位,1970-????)myDate.getMonth(); //获取当前月份(0-11,0代表1月)myDate.getDate(); //获取当前日(1-31)myDate.getDay(); //获取当前星期X(0-6,0代表星期天)myDate.getTi…