2014-07-07 10 views

risposta

20

Perché si passa stringa mentre si aspetta data_diff oggetto datetime,

$date_expire = '2014-08-06 00:00:00';  
$date = new DateTime($date_expire); 
$now = new DateTime(); 

echo $date->diff($now)->format("%d days, %h hours and %i minuts"); 

DEMO.

Problemi correlati