3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); echo $date->format('Y-m-d H:i:s') . PHP_EOL; $date = new DateTime('-5 minutes'); echo $date->format('Y-m-d H:i:s') . PHP_EOL; $date2 = clone $date; $date2->modify('-10 minutes'); echo $date2->format('Y-m-d H:i:s') . PHP_EOL; echo $date->format('Y-m-d H:i:s');
Output for 5.6.28, 7.0.14 - 7.1.0
2014-03-10 22:29:00 2014-03-10 22:24:00 2014-03-10 22:14:00 2014-03-10 22:24:00
Output for 7.0.6
2016-05-03 02:12:26 2016-05-03 02:07:26 2016-05-03 01:57:26 2016-05-03 02:07:26
Output for 7.0.5
2016-04-02 15:27:39 2016-04-02 15:22:39 2016-04-02 15:12:39 2016-04-02 15:22:39
Output for 7.0.4
2016-03-10 00:55:56 2016-03-10 00:50:56 2016-03-10 00:40:56 2016-03-10 00:50:56
Output for 7.0.3
2016-03-18 01:08:10 2016-03-18 01:03:10 2016-03-18 00:53:10 2016-03-18 01:03:10
Output for 7.0.2
2016-03-21 11:43:16 2016-03-21 11:38:16 2016-03-21 11:28:16 2016-03-21 11:38:16
Output for 7.0.1
2016-03-23 11:55:00 2016-03-23 11:50:00 2016-03-23 11:40:00 2016-03-23 11:50:00
Output for 7.0.0
2016-03-26 14:26:21 2016-03-26 14:21:21 2016-03-26 14:11:21 2016-03-26 14:21:21
Output for 5.6.21
2016-05-01 21:14:46 2016-05-01 21:09:46 2016-05-01 20:59:46 2016-05-01 21:09:46
Output for 5.6.20
2016-04-09 10:42:26 2016-04-09 10:37:26 2016-04-09 10:27:26 2016-04-09 10:37:26
Output for 5.6.19
2016-03-06 23:11:16 2016-03-06 23:06:16 2016-03-06 22:56:16 2016-03-06 23:06:16
Output for 5.6.18
2016-03-14 10:51:28 2016-03-14 10:46:28 2016-03-14 10:36:28 2016-03-14 10:46:28
Output for 5.6.17
2016-03-19 05:37:07 2016-03-19 05:32:07 2016-03-19 05:22:07 2016-03-19 05:32:07
Output for 5.6.16
2016-03-27 16:11:24 2016-03-27 16:06:24 2016-03-27 15:56:24 2016-03-27 16:06:24
Output for 5.6.15
2016-03-28 17:05:00 2016-03-28 17:00:00 2016-03-28 16:50:00 2016-03-28 17:00:00
Output for 5.6.14
2016-04-01 19:43:30 2016-04-01 19:38:30 2016-04-01 19:28:30 2016-04-01 19:38:30
Output for 5.6.13
2016-04-14 23:31:25 2016-04-14 23:26:25 2016-04-14 23:16:25 2016-04-14 23:26:25
Output for 5.6.12
2016-04-19 12:39:41 2016-04-19 12:34:41 2016-04-19 12:24:41 2016-04-19 12:34:41
Output for 5.6.11
2016-04-22 19:55:46 2016-04-22 19:50:46 2016-04-22 19:40:46 2016-04-22 19:50:46
Output for 5.6.10
2016-04-24 21:35:48 2016-04-24 21:30:48 2016-04-24 21:20:48 2016-04-24 21:30:48
Output for 5.6.9
2016-04-27 02:44:55 2016-04-27 02:39:55 2016-04-27 02:29:55 2016-04-27 02:39:55
Output for 5.6.8
2016-04-29 10:20:08 2016-04-29 10:15:08 2016-04-29 10:05:08 2016-04-29 10:15:08
Output for 5.6.7
2016-05-24 21:00:31 2016-05-24 20:55:31 2016-05-24 20:45:31 2016-05-24 20:55:31
Output for 5.5.35
2016-05-22 00:35:05 2016-05-22 00:30:05 2016-05-22 00:20:05 2016-05-22 00:30:05
Output for 5.5.34
2016-04-10 16:38:07 2016-04-10 16:33:07 2016-04-10 16:23:07 2016-04-10 16:33:07
Output for 5.5.33
2016-03-08 11:50:05 2016-03-08 11:45:05 2016-03-08 11:35:05 2016-03-08 11:45:05
Output for 5.5.32
2016-03-16 17:30:44 2016-03-16 17:25:44 2016-03-16 17:15:44 2016-03-16 17:25:44
Output for 5.5.31
2016-03-20 08:30:06 2016-03-20 08:25:06 2016-03-20 08:15:06 2016-03-20 08:25:06
Output for 5.5.30
2016-03-31 19:06:26 2016-03-31 19:01:26 2016-03-31 18:51:26 2016-03-31 19:01:26
Output for 5.5.29
2016-04-16 13:38:08 2016-04-16 13:33:08 2016-04-16 13:23:08 2016-04-16 13:33:08
Output for 5.5.28
2016-04-20 15:54:04 2016-04-20 15:49:04 2016-04-20 15:39:04 2016-04-20 15:49:04
Output for 5.5.27
2016-04-21 18:27:32 2016-04-21 18:22:32 2016-04-21 18:12:32 2016-04-21 18:22:32
Output for 5.5.26
2016-04-25 23:53:08 2016-04-25 23:48:08 2016-04-25 23:38:08 2016-04-25 23:48:08
Output for 5.5.25
2016-04-28 06:01:20 2016-04-28 05:56:20 2016-04-28 05:46:20 2016-04-28 05:56:20
Output for 5.5.24
2016-04-30 13:32:39 2016-04-30 13:27:39 2016-04-30 13:17:39 2016-04-30 13:27:39
Output for 5.4.45
2015-09-14 04:17:33 2015-09-14 04:12:33 2015-09-14 04:02:33 2015-09-14 04:12:33
Output for 5.4.44
2015-09-14 04:17:31 2015-09-14 04:12:31 2015-09-14 04:02:31 2015-09-14 04:12:31
Output for 5.4.43
2015-09-14 04:17:27 2015-09-14 04:12:27 2015-09-14 04:02:27 2015-09-14 04:12:27
Output for 5.4.42
2015-09-14 04:17:26 2015-09-14 04:12:26 2015-09-14 04:02:26 2015-09-14 04:12:26
Output for 5.4.41
2015-09-14 04:17:24 2015-09-14 04:12:24 2015-09-14 04:02:24 2015-09-14 04:12:24
Output for 5.4.40
2015-05-10 16:57:25 2015-05-10 16:52:25 2015-05-10 16:42:25 2015-05-10 16:52:25
Output for 5.4.39
2015-05-10 16:57:24 2015-05-10 16:52:24 2015-05-10 16:42:24 2015-05-10 16:52:24
Output for 5.4.38
2015-03-02 13:42:11 2015-03-02 13:37:11 2015-03-02 13:27:11 2015-03-02 13:37:11
Output for 5.4.36 - 5.4.37
2015-02-08 09:37:52 2015-02-08 09:32:52 2015-02-08 09:22:52 2015-02-08 09:32:52
Output for 5.4.34 - 5.4.35
2015-02-08 09:37:51 2015-02-08 09:32:51 2015-02-08 09:22:51 2015-02-08 09:32:51
Output for 5.4.32
2014-09-07 09:12:03 2014-09-07 09:07:03 2014-09-07 08:57:03 2014-09-07 09:07:03
Output for 5.4.31
2014-09-07 09:11:59 2014-09-07 09:06:59 2014-09-07 08:56:59 2014-09-07 09:06:59
Output for 5.3.29, 5.4.30
2014-09-07 09:11:56 2014-09-07 09:06:56 2014-09-07 08:56:56 2014-09-07 09:06:56
Output for 5.4.28 - 5.4.29
2014-09-07 09:11:55 2014-09-07 09:06:55 2014-09-07 08:56:55 2014-09-07 09:06:55
Output for 5.4.27
2014-09-07 09:12:00 2014-09-07 09:07:00 2014-09-07 08:57:00 2014-09-07 09:07:00
Output for 5.4.21 - 5.4.26
2014-03-10 22:29:01 2014-03-10 22:24:01 2014-03-10 22:14:01 2014-03-10 22:24:01
Output for 5.4.3 - 5.4.20
2014-03-10 22:29:02 2014-03-10 22:24:02 2014-03-10 22:14:02 2014-03-10 22:24:02
Output for 5.3.14 - 5.3.28, 5.4.0 - 5.4.2
2014-03-10 22:29:03 2014-03-10 22:24:03 2014-03-10 22:14:03 2014-03-10 22:24:03
Output for 5.2.11 - 5.3.13
2014-03-10 22:29:04 2014-03-10 22:24:04 2014-03-10 22:14:04 2014-03-10 22:24:04
Output for 5.2.0 - 5.2.10
2014-03-10 22:29:05 2014-03-10 22:24:05 2014-03-10 22:14:05 2014-03-10 22:24:05
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/OdM8W on line 2
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_VARIABLE in /in/OdM8W on line 9
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_VARIABLE in /in/OdM8W on line 9
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/OdM8W on line 9
Process exited with code 255.