fork download
  1. <?php
  2.  
  3. $now = new \DateTime('14:17:00');
  4.  
  5. $ev = new \DateTime('17:15:00');
  6.  
  7. var_dump($ev->diff($now));
Success #stdin #stdout 0.01s 83904KB
stdin
Standard input is empty
stdout
object(DateInterval)#3 (16) {
  ["y"]=>
  int(0)
  ["m"]=>
  int(0)
  ["d"]=>
  int(0)
  ["h"]=>
  int(2)
  ["i"]=>
  int(58)
  ["s"]=>
  int(0)
  ["f"]=>
  float(0)
  ["weekday"]=>
  int(0)
  ["weekday_behavior"]=>
  int(0)
  ["first_last_day_of"]=>
  int(0)
  ["invert"]=>
  int(1)
  ["days"]=>
  int(0)
  ["special_type"]=>
  int(0)
  ["special_amount"]=>
  int(0)
  ["have_weekday_relative"]=>
  int(0)
  ["have_special_relative"]=>
  int(0)
}