在 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));