怎么样改可以让执行代码在timeteam[n] <= endtime 的条件下执行循环?
//时间 var startdate = new Date("2016-10-24 20:00:00"); var starttime = startdate.getTime(); var enddate = new Date("2016-10-26 20:00:00"); var endtime = enddate.getTime(); var timeteam = new Array(); var s = 0; var sri = ""; var m; var n = 0 do{ timeteam[n] = starttime + 1800000*s; s++; var myDate = new Date(timeteam[n]); var m = myDate.getFullYear() + "/" + myDate.getMonth() + "/" + myDate.getDate() + " " + myDate.getHours() + ":" + myDate.getMinutes() + ","; sri = sri + m; n++; } while(n < 20) var ss = sri.split(","); ss.pop(); console.log(ss);
}while(true);
一周热门 更多>