2014-11-23 82 views

回答

2

你能做到這一點

$interval = new DateInterval('P2Y4DT6H8M'); 
$str = $interval->format('%d:%h:%i:%s'); 
list($days, $hours, $minutes, $seconds) = explode(':', $str); 
$elapsedSeconds = ($days*86400) + ($hours*3600) + ($minutes*60) + $seconds; 
echo $elapsedSeconds; 
0

使用的strtotime:

echo strtotime('2012-03-27 18:47:00'); // - >這將導致到1332866820