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 testRange() { $ltm = localtime(strtotime('2020-09-28'),true); } private function year_day() { $ltm = localtime(strtotime('2020-09-28'),true); return $ltm['tm_yday']; } public function testMtrand() { for ($i = 0; $i < 100; $i++) { echo mt_rand(0,6); echo "\n"; } $世界 = '⬇'; } public function testPeriod() { $date = date('Y-m-d',time()); $period = ['start' => '08:30']; $day_start = strtotime("{$date} {$period['start']}"); if(empty($period['end'])) { $day_end = strtotime("{$date}") + 86400; } else { $day_end = strtotime("{$date} {$period['end']}"); } } public function testZero() { $x = time(); $date = date('Y-m-d H:i:s',1619020800); $day_start = strtotime("{$date}"); } public function testDate() { $date = date('Y-m-d',time()); $day_start = strtotime("{$date}"); $begin = $day_start - 6 * 86400; } public function testFloat() { $t = intval("30.00" + 0.05); $x = 1.6; $y = 8; $t = $x == ($y - 6.4); $z = $y - 6.4; $ta = round($x,2) == round($y - 6.4,2); } public function testMd5() { $x = 'amount=100.00&cardno=1000113200030706234&mchid=10104&order_sn=200000001743&state=CANCEL&trade_no=970664650712097821&key=10086'; $y = md5($x); } public function testSuning() { $x = date("YmdHis",time()); } }