【发布时间】:2012-11-21 12:38:45
【问题描述】:
在 PHP 中我有:
$diff = abs(strtotime(date('m/d/Y h:i:s')) - strtotime($latest));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
echo floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
我如何获得以秒为单位的差异?我尝试了以下方法:
$diff = abs(strtotime(date('m/d/Y h:i:s')) - strtotime($latest));
【问题讨论】:
-
复制本站搜索选项:stackoverflow.com/…