3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new \DateTime('2015-05-24 00:00:00'); $time = new \DateTime('0000-00-00 21:22:00'); $pickUpDateTime = new \DateTime(); $pickUpDateTime->setDate($date->format('Y'), $date->format('m'), $date->format('d')); $pickUpDateTime->setTime($time->format('H'), $time->format('i'), $time->format('s')); $now = new DateTime("now"); $interval = date_diff($now, $pickUpDateTime); if ( $v = $interval->h >= 1 ) echo ($interval->y*365*24)+($interval->d*24)+ $interval->h ;
based on 3hLYQ
Output for 5.3.21 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
255
Output for 7.0.6
663
Output for 7.0.5
227
Output for 7.0.4
Output for 7.0.3
601
Output for 7.0.2
703
Output for 7.0.1
730
Output for 7.0.0
60
Output for 5.6.21
210
Output for 5.6.20
395
Output for 5.6.19
344
Output for 5.6.18
521
Output for 5.6.17
628
Output for 5.6.16
85
Output for 5.6.15
110
Output for 5.6.14
500
Output for 5.6.13
524
Output for 5.6.12
635
Output for 5.6.11
737
Output for 5.6.10
19
Output for 5.6.9
73
Output for 5.6.8
129
Output for 5.5.35
700
Output for 5.5.34
421
Output for 5.5.33
371
Output for 5.5.32
573
Output for 5.5.31
655
Output for 5.5.30
184
Output for 5.5.29
563
Output for 5.5.28
662
Output for 5.5.27
688
Output for 5.5.26
46
Output for 5.5.25
101
Output for 5.5.24
732