3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $d = new DateTime(); $d->modify("last day of december"); //$d->setTime(24,0,0); echo $d->format("Y-m-d H:i:s");
based on ELlBd
Output for 5.6.28, 7.0.14 - 7.1.0
2014-12-31 19:04:58
Output for 7.0.6
2016-12-31 08:13:40
Output for 7.0.5
2016-12-31 21:10:25
Output for 7.0.4
2016-12-31 07:27:44
Output for 7.0.3
2016-12-31 08:00:33
Output for 7.0.2
2016-12-31 13:46:03
Output for 7.0.1
2016-12-31 18:46:21
Output for 7.0.0
2016-12-31 20:26:34
Output for 5.6.21
2016-12-31 03:33:23
Output for 5.6.20
2016-12-31 20:01:31
Output for 5.6.19
2016-12-31 15:34:39
Output for 5.6.18
2016-12-31 23:20:20
Output for 5.6.17
2016-12-31 12:19:01
Output for 5.6.16
2016-12-31 22:12:16
Output for 5.6.15
2016-12-31 23:05:09
Output for 5.6.14
2016-12-31 01:39:25
Output for 5.6.13
2016-12-31 05:34:46
Output for 5.6.12
2016-12-31 19:12:18
Output for 5.6.11
2016-12-31 02:12:28
Output for 5.6.10
2016-12-31 04:02:12
Output for 5.6.9
2016-12-31 08:59:32
Output for 5.6.8
2016-12-31 17:00:21
Output for 5.6.7
2016-12-31 11:29:13
Output for 5.5.35
2016-12-31 07:14:51
Output for 5.5.34
2016-12-31 22:26:56
Output for 5.5.33
2016-12-31 18:23:55
Output for 5.5.32
2016-12-31 01:11:53
Output for 5.5.31
2016-12-31 15:05:48
Output for 5.5.30
2016-12-31 01:13:34
Output for 5.5.29
2016-12-31 19:39:49
Output for 5.5.28
2016-12-31 22:17:57
Output for 5.5.27
2016-12-31 00:48:52
Output for 5.5.26
2016-12-31 06:28:17
Output for 5.5.25
2016-12-31 12:31:43
Output for 5.5.24
2016-12-31 19:27:30
Output for 5.4.45
2015-12-31 12:28:18
Output for 5.4.44
2015-12-31 12:28:21
Output for 5.4.43
2015-12-31 12:28:25
Output for 5.4.42
2015-12-31 12:28:27
Output for 5.4.41
2015-12-31 12:28:28
Output for 5.4.40
2015-12-31 12:28:31
Output for 5.4.39
2015-12-31 12:28:33
Output for 5.4.38
2015-12-31 12:28:34
Output for 5.4.37
2015-12-31 12:28:36
Output for 5.4.36
2015-12-31 12:28:37
Output for 5.4.35
2015-12-31 12:28:38
Output for 5.4.34
2015-12-31 12:28:40
Output for 5.4.32
2015-12-31 12:28:42
Output for 5.4.31
2015-12-31 12:28:44
Output for 5.4.30
2015-12-31 12:28:45
Output for 5.4.29
2015-12-31 12:28:46
Output for 5.4.28
2015-12-31 12:28:47
Output for 5.4.27
2015-12-31 12:28:48
Output for 5.4.26
2015-12-31 12:28:49
Output for 5.4.25
2015-12-31 12:28:50
Output for 5.4.24
2015-12-31 12:28:51
Output for 5.3.28, 5.4.23
2015-12-31 12:28:52
Output for 5.4.22
2015-12-31 12:28:53
Output for 5.4.21
2015-12-31 12:28:54
Output for 5.4.20
2015-12-31 12:28:55
Output for 5.4.19
2015-12-31 12:28:57
Output for 5.4.18
2015-12-31 12:28:58
Output for 5.3.27, 5.4.17
2015-12-31 12:28:59
Output for 5.3.26, 5.4.16
2015-12-31 12:29:00
Output for 5.3.25, 5.4.15
2015-12-31 12:29:01
Output for 5.3.24, 5.4.14
2015-12-31 12:29:02
Output for 5.3.23, 5.4.12 - 5.4.13
2015-12-31 12:29:03
Output for 5.3.20, 5.4.11
2015-12-31 12:29:05
Output for 5.4.9 - 5.4.10
2015-12-31 12:29:06
Output for 5.3.18 - 5.3.19, 5.4.8
2015-12-31 12:29:07
Output for 5.3.17, 5.4.7
2015-12-31 12:29:08
Output for 5.3.16, 5.4.6
2015-12-31 12:29:09
Output for 5.3.15, 5.4.5
2015-12-31 12:29:10
Output for 5.3.14, 5.4.4
2015-12-31 12:29:11
Output for 5.3.13, 5.4.3
2015-12-31 12:29:12
Output for 5.3.11 - 5.3.12, 5.4.2
2015-12-31 12:29:13
Output for 5.4.0 - 5.4.1
2015-12-31 12:29:14
Output for 5.3.29
2015-12-31 12:28:43
Output for 5.3.21 - 5.3.22
2015-12-31 12:29:04
Output for 5.3.9 - 5.3.10
2015-12-31 12:29:15
Output for 5.3.8
2015-12-31 12:29:16
Output for 5.3.6 - 5.3.7
2015-12-31 12:29:17
Output for 5.3.5
2015-11-30 12:29:17
Output for 5.3.4
2015-11-30 12:29:19
Output for 5.3.2 - 5.3.3
2015-11-30 12:29:20
Output for 5.3.1
2015-11-30 12:29:21
Output for 5.3.0
2015-11-30 12:29:22
Output for 5.2.16 - 5.2.17
Warning: DateTime::modify(): Failed to parse time string (last day of december) at position 9 (o): The timezone could not be found in the database in /in/6i1O0 on line 3 2015-11-10 12:29:18
Output for 5.2.15
Warning: DateTime::modify(): Failed to parse time string (last day of december) at position 9 (o): The timezone could not be found in the database in /in/6i1O0 on line 3 2015-11-10 12:29:19
Output for 5.2.13 - 5.2.14
Warning: DateTime::modify(): Failed to parse time string (last day of december) at position 9 (o): The timezone could not be found in the database in /in/6i1O0 on line 3 2015-11-10 12:29:20
Output for 5.2.12
2015-11-09 12:29:20
Output for 5.2.11
2015-11-09 12:29:21
Output for 5.2.9 - 5.2.10
2015-11-09 12:29:22
Output for 5.2.7 - 5.2.8
2015-11-09 12:29:23
Output for 5.2.5 - 5.2.6
2015-11-09 12:29:24
Output for 5.2.2 - 5.2.4
2015-11-09 12:29:25
Output for 5.2.1
2015-11-09 12:29:26
Output for 5.2.0
2015-11-09 12:29:27
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/6i1O0 on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/6i1O0 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/6i1O0 on line 2