// date为日期,days为天数 function AddDays(date, days) { var nd = new Date(date); nd = nd.valueOf(); nd = nd + days * 24 * 60 * 60 * 1000; nd = new Date(nd); var y = nd.getFullYear(); var m = nd.getMonth() + 1; var d = nd.getDate(); if (m <= 9) m = "0" + m; if (d <= 9) d = "0" + d; var cdate = y + "-" + m + "-" + d + ‘ ‘+nd.getHours() + ‘:‘ + nd.getMinutes() + ‘:‘ + nd.getDate(); return cdate; }
jquery操作日期
时间: 2024-11-08 18:47:18