12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- /**
- * Created by PhpStorm.
- * User: stanley-king
- * Date: 2017/5/25
- * Time: 上午10:21
- */
- class TestTime extends PHPUnit_Framework_TestCase
- {
- public function testS()
- {
- $tm = strtotime('2017-08-01 3:43:00');
- $tm1 = strtotime('2017-8-01 3:43:00');
- $tm2 = strtotime('2017-08-1 3:43:00');
- $tm3 = strtotime('2017-8-1 3:43:00');
- $tm3 = strtotime('2017-8-1 03:43:00');
- $tm3 = strtotime('2017-8-1 3:43:00');
- $tm3 = strtotime('2017-8-1 3:43');
- }
- public function testDay()
- {
- $date = date('Y-m-d',time());
- $this->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();
- }
- }
|