Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到了一个非常奇怪的问题,代码是:
$timeStr = '2012-12-27 10:01:00'; $test = date('Y-m-d H:m:s',strtotime($timeStr)); echo ("timeStr : $timeStr <br/> time: $test");
结果是:
timeStr : 2012-12-27 10:01:00 time: 2012-12-27 10:12:00
为什么他们不相等?
更改m为i。m是几个月,i而是几分钟。它应该是
m
i
$test = date('Y-m-d H:i:s',strtotime($timeStr));
进一步参考http://in2.php.net/manual/en/function.date.php