date minus seconds always returns same

echo date('Y-m-d H:m:s', strtotime('15 minutes ago')) . "<br/>";
echo date('Y-m-d H:m:s', time()-900) . "<br/>";
echo date('Y-m-d H:m:s', time());

我在Windows 7上运行WAMPP,并且所有3次调用都返回同一时间。


'H:m:s' should be 'H:i:s'
   ^                 ^

Spot the difference

  • m = Months
  • i = Minutes

  • The error in your code:

    'Ymd H:m:s' should be 'Ymd H:i:s'

    m is month i is minute

    链接地址: http://www.djcxy.com/p/59024.html

    上一篇: 基于浏览器的代码在Firefox中工作时间很短(适用于Internet Explorer / Chrome)?

    下一篇: 日期减去秒总是返回相同