fork download
  1. <?php
  2.  
  3. $datetime1 = new DateTime('01-04-2018');
  4. $datetime2 = new DateTime('10-04-2018');
  5. $interval = $datetime1->diff($datetime2);
  6. echo $interval->format('%R%a days');
  7.  
Success #stdin #stdout 0.02s 23832KB
stdin
Standard input is empty
stdout
+9 days