3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); var_dump($date); $date2 = \DateTime::createFromFormat('U', $date->format('U'), $date->getTimezone()); var_dump($date2);
based on kUuke
Output for 7.2.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.004118" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.003526" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.7
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.003469" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.005421" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.010366" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.1.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.004000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.28, 7.0.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.6
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-03 20:11:59.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-03 18:11:59.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.5
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-03 08:30:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-03 06:30:25.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.4
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-10 20:27:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-10 19:27:55.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.3
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-18 21:50:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-18 20:50:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.2
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-23 04:04:33.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-23 03:04:33.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-24 07:18:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-24 06:18:24.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 7.0.0
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-27 09:12:39.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-27 07:12:39.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.21
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-02 15:20:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-02 13:20:25.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.20
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-10 07:31:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-10 05:31:57.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.19
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-08 04:40:04.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-08 03:40:04.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.18
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-15 13:31:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-15 12:31:29.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.17
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-20 01:05:57.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-20 00:05:57.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.16
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-28 10:01:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-28 08:01:23.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.15
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-29 10:50:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-29 08:50:49.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.14
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-14 16:31:56.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-14 14:31:56.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-15 17:12:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-15 15:12:30.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.12
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-20 07:39:34.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-20 05:39:34.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.11
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-24 14:04:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-24 12:04:54.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.10
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-25 16:09:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-25 14:09:08.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.9
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-27 21:17:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-27 19:17:25.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.6.8
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-30 06:07:24.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-30 04:07:24.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.35
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-23 00:24:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-22 22:24:05.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-11 09:43:32.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-11 07:43:32.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.33
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-09 07:34:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-09 06:34:44.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.32
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-17 17:25:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-17 16:25:54.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-03-21 04:12:14.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-03-21 03:12:14.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-01 12:43:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-01 10:43:08.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.29
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-17 07:30:07.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-17 05:30:07.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.28
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-21 10:56:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-21 08:56:44.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.27
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-22 12:38:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-22 10:38:02.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.26
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-26 18:49:03.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-26 16:49:03.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.25
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-04-29 02:13:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-04-29 00:13:46.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.5.24
object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-24 16:43:49.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2016-05-24 14:43:49.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.44 - 5.4.45
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:06.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:06.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.42 - 5.4.43
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:08.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.40 - 5.4.41
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:09.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:09.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.38 - 5.4.39
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:10.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.35 - 5.4.37
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:11.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.32 - 5.4.34
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:12.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:12.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.30 - 5.4.31
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-12-08 17:52:13.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(26) "2015-12-08 16:52:13.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.28 - 5.4.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:13" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:13" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.4.24 - 5.4.27
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:14" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:14" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.28, 5.4.20 - 5.4.23
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:15" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:15" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.27, 5.4.17 - 5.4.19
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:16" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:16" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.23 - 5.3.26, 5.4.13 - 5.4.16
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:17" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:17" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.20 - 5.3.22, 5.4.10 - 5.4.12
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:18" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:18" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }
Output for 5.3.29
object(DateTime)#1 (3) { ["date"]=> string(19) "2015-12-08 17:52:12" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTime)#3 (3) { ["date"]=> string(19) "2015-12-08 16:52:12" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" }