3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $eet = new DateTimeZone('EEST'); $msk = new DateTimeZone('Europe/Moscow'); $d = (new DateTime('now', $msk))->setTimezone($eet); $d1 = clone $d; $d->setTimezone($msk); var_dump($d, $d1);
based on JW2Ot
Output for 7.2.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:06.003748" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.003748" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.1.10
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:06.005502" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.005502" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.1.7
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:06.004805" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.004805" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.1.6
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:06.006459" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.006459" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.1.5
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:06.005739" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.005739" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.1.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 19:52:06.003898" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.003898" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.20
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.6
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-03 21:27:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-03 18:27:06.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.5
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-03 09:52:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-03 06:52:32.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.4
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 22:39:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-10 19:39:07.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.3
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 23:47:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-18 20:47:30.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.2
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-23 05:54:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-23 02:54:57.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.1
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-24 09:34:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-24 06:34:40.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 7.0.0
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 10:30:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-27 07:30:56.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.28
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 19:52:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:06.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.21
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 16:36:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-02 13:36:27.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.20
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 08:51:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-10 05:51:51.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.19
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 06:50:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-08 03:50:29.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.18
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-15 15:33:45.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-15 12:33:45.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.17
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-20 03:13:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-20 00:13:24.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.16
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 11:18:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-28 08:18:13.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.15
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-29 12:08:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-29 09:08:56.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.14
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-02 14:00:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-02 11:00:04.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.13
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-15 18:24:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-15 15:24:11.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.12
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 08:53:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-20 05:53:13.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.11
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-24 15:15:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-24 12:15:30.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.10
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 17:18:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-25 14:18:33.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.9
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-27 22:28:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-27 19:28:39.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.6.8
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 07:21:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-30 04:21:02.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.35
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-22 23:43:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-22 20:43:54.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.34
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-11 11:03:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-11 08:03:40.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.33
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-09 09:33:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-09 06:33:26.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.32
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-17 19:28:58.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-17 16:28:58.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.31
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 06:15:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-03-21 03:15:08.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.30
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 14:02:31.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-01 11:02:31.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.29
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-17 08:47:26.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-17 05:47:26.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.28
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 12:07:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-21 09:07:06.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.27
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 13:53:43.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-22 10:53:43.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.26
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 20:01:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-26 17:01:16.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.25
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 02:53:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-04-28 23:53:52.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.5.24
object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 09:26:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2016-05-24 06:26:57.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(4) "EEST" }
Output for 5.4.42 - 5.4.45
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:17.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.34 - 5.4.41
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 17:52:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:18.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.30 - 5.4.32
object(DateTime)#3 (3) { ["date"]=> string(26) "2015-11-06 18:52:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(26) "2015-11-06 16:52:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.25 - 5.4.29
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:52:19" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:52:19" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.17 - 5.4.24
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:52:20" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:52:20" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.10 - 5.4.16
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:52:21" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:52:21" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.3 - 5.4.9
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:52:22" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:52:22" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.4.0 - 5.4.2
object(DateTime)#3 (3) { ["date"]=> string(19) "2015-11-06 18:52:23" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Moscow" } object(DateTime)#4 (3) { ["date"]=> string(19) "2015-11-06 16:52:23" ["timezone_type"]=> int(3) ["timezone"]=> string(15) "Europe/Helsinki" }
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/rivro on line 5
Process exited with code 255.