3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateTime = new DateTime('now'); var_dump($dateTime->setTimezone(new DateTimeZone('GMT')));
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.004139" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.003737" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.003876" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.007956" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.007773" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.004020" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.28, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-03 17:51:57.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-03 06:11:49.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-10 19:05:59.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-18 20:26:59.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-23 02:40:45.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-24 05:57:46.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 06:52:16.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 13:00:03.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 05:13:03.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-08 03:18:34.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 12:08:32.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-19 23:43:40.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 07:41:24.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-29 08:30:58.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-02 10:21:13.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-15 14:52:30.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 05:19:15.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-24 11:44:05.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 13:47:52.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 18:56:15.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 03:45:13.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-22 21:57:24.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-11 07:24:24.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-09 06:11:13.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 16:00:01.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-21 02:49:08.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 10:23:51.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-17 05:10:30.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-21 08:35:06.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 10:17:50.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 16:28:28.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-28 23:52:03.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-24 06:03:06.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(3) "GMT" }
Output for 5.4.44 - 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.41 - 5.4.42
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.38 - 5.4.40
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.36 - 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.34 - 5.4.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.30 - 5.4.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-01 08:19:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.26 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:10" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.3.28, 5.4.23 - 5.4.25
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:11" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.4.19 - 5.4.22
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:12" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.3.27, 5.4.17 - 5.4.18
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:13" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:14" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.3.20 - 5.3.22, 5.4.10 - 5.4.12
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:15" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-01 08:19:09" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }