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 = $now->diff( $pickUpDateTime );; print $interval->format("%Y-%m-%d %H:%I:%S");
based on qKvF9
Output for 5.6.28, 7.0.20 - 7.2.0
00-7-10 15:08:46
Output for 7.0.6
00-11-27 15:56:04
Output for 7.0.5
00-10-9 11:58:31
Output for 7.0.4
00-9-17 00:04:55
Output for 7.0.3
00-9-25 01:28:17
Output for 7.0.2
00-9-29 07:41:31
Output for 7.0.1
00-9-30 10:49:15
Output for 7.0.0
00-10-2 12:42:40
Output for 5.6.21
00-11-8 18:51:24
Output for 5.6.20
00-10-16 11:00:23
Output for 5.6.19
00-9-14 08:12:52
Output for 5.6.18
00-9-21 17:09:47
Output for 5.6.17
00-9-26 04:41:48
Output for 5.6.16
00-10-3 13:31:54
Output for 5.6.15
00-10-4 14:21:02
Output for 5.6.14
00-10-20 20:03:32
Output for 5.6.13
00-10-21 20:42:36
Output for 5.6.12
00-10-26 11:11:32
Output for 5.6.11
00-10-30 17:37:21
Output for 5.6.10
00-11-0 19:43:23
Output for 5.6.9
00-11-3 01:09:15
Output for 5.6.8
00-11-5 09:39:41
Output for 5.5.35
00-11-29 04:38:21
Output for 5.5.34
00-10-17 13:14:10
Output for 5.5.33
00-9-15 11:11:43
Output for 5.5.32
00-9-23 21:05:55
Output for 5.5.31
00-9-27 07:50:32
Output for 5.5.30
00-10-7 16:13:15
Output for 5.5.29
00-10-23 11:00:16
Output for 5.5.28
00-10-27 14:29:59
Output for 5.5.27
00-10-28 16:08:55
Output for 5.5.26
00-11-1 22:23:57
Output for 5.5.25
00-11-4 05:49:18
Output for 5.5.24
00-11-30 12:12:49
Output for 5.4.45
00-7-10 15:08:51
Output for 5.4.44
00-7-10 15:08:52
Output for 5.4.43
00-7-10 15:08:53
Output for 5.4.41 - 5.4.42
00-7-10 15:08:54
Output for 5.4.40
00-7-10 15:08:55
Output for 5.4.37 - 5.4.39
00-7-10 15:08:56
Output for 5.4.35 - 5.4.36
00-7-10 15:08:57
Output for 5.4.34
00-7-10 15:08:58
Output for 5.3.29, 5.4.29 - 5.4.32
00-7-10 15:08:59
Output for 5.4.25 - 5.4.28
00-7-10 15:09:00
Output for 5.3.28, 5.4.22 - 5.4.24
00-7-10 15:09:01
Output for 5.4.19 - 5.4.21
00-7-10 15:09:02
Output for 5.3.27, 5.4.17 - 5.4.18
00-7-10 15:09:03
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
00-7-10 15:09:04
Output for 5.3.21 - 5.3.22, 5.4.11 - 5.4.12
00-7-10 15:09:05