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(); } public function testLastsec() { $expried_secs = 10 * 24 * 3600; $usable_time = time() + $expried_secs; $cur_date = date('Y-m-d H:i:s',$usable_time); $cur_time = strtotime(date('Y-m-d',$usable_time)) + 86399; $curx_date = date('Y-m-d H:i:s',$cur_time); $cur_time = util::last_day_secs($usable_time); $cury_date = date('Y-m-d H:i:s',$cur_time); $delta = $usable_time - $cur_time; } public function testMtrand() { for ($i = 0; $i < 100; $i++) { echo mt_rand(0,6); echo "\n"; } } }