var dt = new Date(); m=dt.getMonth()+1;//获得月份 d=dt.getDate();//获取日 y=dt.getFullYear(); //获取年(四位) if(m < 10){ m = "0" + m; }else{ m = m; } //判断 日n if(d < 10){//如果天数<10 d = "0" + d; }else{ d = d; } self.startTime = y+'-'+m+'-'+d+' 00:00:00'; self.endTime = y+'-'+m+'-'+d+' 23:59:59';
标签:10,00,天数,self,js,获取,dt From: https://www.cnblogs.com/aleng1106/p/17036080.html