mStartm = strtotime(date('Y-m-d',time())); $this->mEndtm = $this->mStartm + 86400 - 1; } public function testWeek() { $date = date('Y-m-d',time()); $cur_time = strtotime(date('Y-m-d',time())) + 86400; $start = $cur_time - 86400 * 7; $end = $cur_time -1; $v = ($end - $start + 1) / 86400; } public function testMonth() { $cur = time(); $cur_date = new DateTime(); $cur_date->setTimestamp($cur); $inter = new DateInterval('P1M'); $cur_date->sub($inter); $time = $cur_date->getTimestamp(); } }