$date1 = new DateTime("your_date"); $date1 = new DateTime("your_date"); $diff=date_diff($date1,$date2); echo $diff->format("%R%a days");