fork download
  1. <?php
  2.  
  3. $datetime1 = new DateTime('2009-10-11');
  4. $datetime2 = new DateTime('2009-10-23');
  5. $interval = $datetime1->diff($datetime2);
  6. echo $interval->days;
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
12