Date.prototype.format=function (){var s=‘‘;s+=this.getFullYear()+‘-‘;// 获取年份。s+=(this.getMonth()+1)+"-"; // 获取月份。s+= this.getDate(); // 获取日。return(s); // 返回日期。};function getAll(begin,end){var ab = begin.split("-");var ae = end.split("-");var db = new Date();db.setUTCFullYear(ab[0], ab[1]-1, ab[2]);var de = new Date();de.setUTCFullYear(ae[0], ae[1]-1, ae[2]);var unixDb=db.getTime();var unixDe=de.getTime();for(var k=unixDb+24*60*60*1000;k<unixDe;){console.log((new Date(parseInt(k))).format());k=k+24*60*60*1000;}}
时间: 2024-11-01 21:03:53