3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime("30 minutes ago"); echo $date->format('Y-m-d H:i:s').'<br>'; $date = new DateTime("30 minutes"); echo $date->format('Y-m-d H:i:s').'<br>'; $date = new DateTime(); echo $date->format('Y-m-d H:i:s').'<br>';
based on NolTo
Output for 5.6.28, 7.0.20 - 7.2.6
2016-01-11 17:13:41<br>2016-01-11 18:13:41<br>2016-01-11 17:43:41<br>
Output for 7.0.6
2016-05-21 13:08:29<br>2016-05-21 14:08:29<br>2016-05-21 13:38:29<br>
Output for 7.0.5
2016-04-03 09:07:47<br>2016-04-03 10:07:47<br>2016-04-03 09:37:47<br>
Output for 7.0.4
2016-03-10 21:14:23<br>2016-03-10 22:14:23<br>2016-03-10 21:44:23<br>
Output for 7.0.3
2016-03-18 22:40:45<br>2016-03-18 23:40:45<br>2016-03-18 23:10:45<br>
Output for 7.0.2
2016-03-23 04:54:04<br>2016-03-23 05:54:04<br>2016-03-23 05:24:04<br>
Output for 7.0.1
2016-03-24 07:59:16<br>2016-03-24 08:59:16<br>2016-03-24 08:29:16<br>
Output for 7.0.0
2016-03-27 09:52:29<br>2016-03-27 10:52:29<br>2016-03-27 10:22:29<br>
Output for 5.6.21
2016-05-02 16:01:30<br>2016-05-02 17:01:30<br>2016-05-02 16:31:30<br>
Output for 5.6.20
2016-04-10 08:09:52<br>2016-04-10 09:09:52<br>2016-04-10 08:39:52<br>
Output for 5.6.19
2016-03-08 05:23:28<br>2016-03-08 06:23:28<br>2016-03-08 05:53:28<br>
Output for 5.6.18
2016-03-15 14:21:19<br>2016-03-15 15:21:19<br>2016-03-15 14:51:19<br>
Output for 5.6.17
2016-03-20 01:53:57<br>2016-03-20 02:53:57<br>2016-03-20 02:23:57<br>
Output for 5.6.16
2016-03-28 10:42:06<br>2016-03-28 11:42:06<br>2016-03-28 11:12:06<br>
Output for 5.6.15
2016-03-29 11:31:01<br>2016-03-29 12:31:01<br>2016-03-29 12:01:01<br>
Output for 5.6.14
2016-04-14 17:14:05<br>2016-04-14 18:14:05<br>2016-04-14 17:44:05<br>
Output for 5.6.13
2016-04-15 17:53:06<br>2016-04-15 18:53:06<br>2016-04-15 18:23:06<br>
Output for 5.6.12
2016-04-20 08:22:26<br>2016-04-20 09:22:26<br>2016-04-20 08:52:26<br>
Output for 5.6.11
2016-04-24 14:48:31<br>2016-04-24 15:48:31<br>2016-04-24 15:18:31<br>
Output for 5.6.10
2016-04-25 16:54:27<br>2016-04-25 17:54:27<br>2016-04-25 17:24:27<br>
Output for 5.6.9
2016-04-27 22:20:30<br>2016-04-27 23:20:30<br>2016-04-27 22:50:30<br>
Output for 5.6.8
2016-04-30 06:49:46<br>2016-04-30 07:49:46<br>2016-04-30 07:19:46<br>
Output for 5.5.35
2016-05-23 02:03:21<br>2016-05-23 03:03:21<br>2016-05-23 02:33:21<br>
Output for 5.5.34
2016-04-11 10:23:45<br>2016-04-11 11:23:45<br>2016-04-11 10:53:45<br>
Output for 5.5.33
2016-03-09 08:22:37<br>2016-03-09 09:22:37<br>2016-03-09 08:52:37<br>
Output for 5.5.32
2016-03-17 18:18:44<br>2016-03-17 19:18:44<br>2016-03-17 18:48:44<br>
Output for 5.5.31
2016-03-21 05:04:25<br>2016-03-21 06:04:25<br>2016-03-21 05:34:25<br>
Output for 5.5.30
2016-04-01 13:23:08<br>2016-04-01 14:23:08<br>2016-04-01 13:53:08<br>
Output for 5.5.29
2016-04-17 08:10:49<br>2016-04-17 09:10:49<br>2016-04-17 08:40:49<br>
Output for 5.5.28
2016-04-21 11:41:57<br>2016-04-21 12:41:57<br>2016-04-21 12:11:57<br>
Output for 5.5.27
2016-04-22 13:18:58<br>2016-04-22 14:18:58<br>2016-04-22 13:48:58<br>
Output for 5.5.26
2016-04-26 19:35:45<br>2016-04-26 20:35:45<br>2016-04-26 20:05:45<br>
Output for 5.5.25
2016-04-29 03:01:35<br>2016-04-29 04:01:35<br>2016-04-29 03:31:35<br>
Output for 5.5.24
2016-05-24 09:24:15<br>2016-05-24 10:24:15<br>2016-05-24 09:54:15<br>
Output for 5.4.44 - 5.4.45
2016-01-11 17:13:45<br>2016-01-11 18:13:45<br>2016-01-11 17:43:45<br>
Output for 5.4.43
2016-01-11 17:13:46<br>2016-01-11 18:13:46<br>2016-01-11 17:43:46<br>
Output for 5.4.41 - 5.4.42
2016-01-11 17:13:47<br>2016-01-11 18:13:47<br>2016-01-11 17:43:47<br>
Output for 5.4.40
2016-01-11 17:13:48<br>2016-01-11 18:13:48<br>2016-01-11 17:43:48<br>
Output for 5.4.38 - 5.4.39
2016-01-11 17:13:49<br>2016-01-11 18:13:49<br>2016-01-11 17:43:49<br>
Output for 5.4.35 - 5.4.37
2016-01-11 17:13:50<br>2016-01-11 18:13:50<br>2016-01-11 17:43:50<br>
Output for 5.4.34
2016-01-11 17:13:51<br>2016-01-11 18:13:51<br>2016-01-11 17:43:51<br>
Output for 5.3.29, 5.4.30 - 5.4.32
2016-01-11 17:13:52<br>2016-01-11 18:13:52<br>2016-01-11 17:43:52<br>
Output for 5.4.27 - 5.4.29
2016-01-11 17:13:53<br>2016-01-11 18:13:53<br>2016-01-11 17:43:53<br>
Output for 5.4.23 - 5.4.26
2016-01-11 17:13:54<br>2016-01-11 18:13:54<br>2016-01-11 17:43:54<br>
Output for 5.3.28, 5.4.20 - 5.4.22
2016-01-11 17:13:55<br>2016-01-11 18:13:55<br>2016-01-11 17:43:55<br>
Output for 5.3.27, 5.4.17 - 5.4.19
2016-01-11 17:13:56<br>2016-01-11 18:13:56<br>2016-01-11 17:43:56<br>
Output for 5.3.24 - 5.3.26, 5.4.14 - 5.4.16
2016-01-11 17:13:57<br>2016-01-11 18:13:57<br>2016-01-11 17:43:57<br>
Output for 5.3.21 - 5.3.23, 5.4.11 - 5.4.13
2016-01-11 17:13:58<br>2016-01-11 18:13:58<br>2016-01-11 17:43:58<br>