3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tz1 = new DateTime('now', new DateTimeZone('UTC')); $tz2 = new DateTime('now', new DateTimeZone('Europe/London')); $tz1->setTimeZone(new DateTimeZone('UTC')); $tz2->setTimeZone(new DateTimeZone('UTC')); var_dump($tz1->format('Y-m-d H:i:s')); var_dump($tz2->format('Y-m-d H:i:s'));
Output for 5.6.28, 7.0.14 - 7.1.0
string(19) "2013-10-29 19:34:17" string(19) "2013-10-29 19:34:17"
Output for 7.0.6
string(19) "2016-05-02 23:30:33" string(19) "2016-05-02 23:30:33"
Output for 7.0.5
string(19) "2016-04-02 12:49:31" string(19) "2016-04-02 12:49:31"
Output for 7.0.4
string(19) "2016-03-09 22:52:23" string(19) "2016-03-09 22:52:23"
Output for 7.0.3
string(19) "2016-03-17 23:19:57" string(19) "2016-03-17 23:19:57"
Output for 7.0.2
string(19) "2016-03-21 09:58:44" string(19) "2016-03-21 09:58:44"
Output for 7.0.1
string(19) "2016-03-23 10:10:04" string(19) "2016-03-23 10:10:04"
Output for 7.0.0
string(19) "2016-03-26 12:44:48" string(19) "2016-03-26 12:44:48"
Output for hhvm-3.12.0
string(19) "2016-03-11 02:56:32" string(19) "2016-03-11 02:56:32"
Output for hhvm-3.10.0
string(19) "2016-03-29 16:20:54" string(19) "2016-03-29 16:20:54"
Output for 5.6.21
string(19) "2016-05-01 18:34:53" string(19) "2016-05-01 18:34:53"
Output for 5.6.20
string(19) "2016-04-09 08:04:34" string(19) "2016-04-09 08:04:34"
Output for 5.6.19
string(19) "2016-03-06 20:49:37" string(19) "2016-03-06 20:49:37"
Output for 5.6.18
string(19) "2016-03-14 08:48:47" string(19) "2016-03-14 08:48:47"
Output for 5.6.17
string(19) "2016-03-19 03:52:31" string(19) "2016-03-19 03:52:31"
Output for 5.6.16
string(19) "2016-03-27 13:29:24" string(19) "2016-03-27 13:29:24"
Output for 5.6.15
string(19) "2016-03-28 14:24:02" string(19) "2016-03-28 14:24:02"
Output for 5.6.14
string(19) "2016-04-01 17:05:04" string(19) "2016-04-01 17:05:04"
Output for 5.6.13
string(19) "2016-04-14 20:52:15" string(19) "2016-04-14 20:52:15"
Output for 5.6.12
string(19) "2016-04-19 09:58:28" string(19) "2016-04-19 09:58:28"
Output for 5.6.11
string(19) "2016-04-22 17:15:32" string(19) "2016-04-22 17:15:32"
Output for 5.6.10
string(19) "2016-04-24 18:54:48" string(19) "2016-04-24 18:54:48"
Output for 5.6.9
string(19) "2016-04-27 00:01:23" string(19) "2016-04-27 00:01:23"
Output for 5.6.8
string(19) "2016-04-29 07:35:03" string(19) "2016-04-29 07:35:03"
Output for 5.6.7
string(19) "2016-05-24 17:51:53" string(19) "2016-05-24 17:51:53"
Output for 5.5.35
string(19) "2016-05-21 21:48:44" string(19) "2016-05-21 21:48:44"
Output for 5.5.34
string(19) "2016-04-10 13:58:29" string(19) "2016-04-10 13:58:29"
Output for 5.5.33
string(19) "2016-03-08 10:07:05" string(19) "2016-03-08 10:07:05"
Output for 5.5.32
string(19) "2016-03-15 19:04:39" string(19) "2016-03-15 19:04:39"
Output for 5.5.31
string(19) "2016-03-20 06:46:02" string(19) "2016-03-20 06:46:02"
Output for 5.5.30
string(19) "2016-03-31 16:26:59" string(19) "2016-03-31 16:26:59"
Output for 5.5.29
string(19) "2016-04-16 10:57:12" string(19) "2016-04-16 10:57:12"
Output for 5.5.28
string(19) "2016-04-20 13:10:41" string(19) "2016-04-20 13:10:41"
Output for 5.5.27
string(19) "2016-04-21 15:47:04" string(19) "2016-04-21 15:47:04"
Output for 5.5.26
string(19) "2016-04-25 21:11:19" string(19) "2016-04-25 21:11:19"
Output for 5.5.25
string(19) "2016-04-28 03:18:17" string(19) "2016-04-28 03:18:17"
Output for 5.5.24
string(19) "2016-04-30 10:54:02" string(19) "2016-04-30 10:54:02"
Output for 5.4.44 - 5.4.45
string(19) "2015-10-12 21:38:35" string(19) "2015-10-12 21:38:35"
Output for 5.4.41 - 5.4.43
string(19) "2015-10-12 21:38:36" string(19) "2015-10-12 21:38:36"
Output for 5.4.38 - 5.4.40
string(19) "2015-10-12 21:38:37" string(19) "2015-10-12 21:38:37"
Output for 5.4.34 - 5.4.37
string(19) "2015-10-12 21:38:38" string(19) "2015-10-12 21:38:38"
Output for 5.4.29 - 5.4.32
string(19) "2015-10-12 21:38:39" string(19) "2015-10-12 21:38:39"
Output for 5.4.26 - 5.4.28
string(19) "2015-10-12 21:38:40" string(19) "2015-10-12 21:38:40"
Output for 5.4.23 - 5.4.25
string(19) "2015-10-12 21:38:41" string(19) "2015-10-12 21:38:41"
Output for 5.4.19 - 5.4.22
string(19) "2015-10-12 21:38:42" string(19) "2015-10-12 21:38:42"
Output for 5.4.16 - 5.4.18
string(19) "2015-10-12 21:38:43" string(19) "2015-10-12 21:38:43"
Output for 5.4.13 - 5.4.15
string(19) "2015-10-12 21:38:44" string(19) "2015-10-12 21:38:44"
Output for 5.4.10 - 5.4.12
string(19) "2015-10-12 21:38:45" string(19) "2015-10-12 21:38:45"
Output for 5.4.6 - 5.4.9
string(19) "2015-10-12 21:38:46" string(19) "2015-10-12 21:38:46"
Output for 5.4.2 - 5.4.5
string(19) "2015-10-12 21:38:47" string(19) "2015-10-12 21:38:47"
Output for 5.3.28 - 5.4.1
string(19) "2015-10-12 21:38:48" string(19) "2015-10-12 21:38:48"
Output for 5.3.23 - 5.3.27
string(19) "2015-10-12 21:38:49" string(19) "2015-10-12 21:38:49"
Output for 5.3.20 - 5.3.22
string(19) "2015-10-12 21:38:50" string(19) "2015-10-12 21:38:50"
Output for 5.3.17 - 5.3.19
string(19) "2015-10-12 21:38:51" string(19) "2015-10-12 21:38:51"
Output for 5.3.13 - 5.3.16
string(19) "2015-10-12 21:38:52" string(19) "2015-10-12 21:38:52"
Output for 5.3.9 - 5.3.12
string(19) "2015-10-12 21:38:53" string(19) "2015-10-12 21:38:53"
Output for 5.3.6 - 5.3.8
string(19) "2015-10-12 21:38:54" string(19) "2015-10-12 21:38:54"
Output for 5.3.3 - 5.3.5
string(19) "2015-10-12 21:38:55" string(19) "2015-10-12 21:38:55"
Output for 5.2.17 - 5.3.2
string(19) "2015-10-12 21:38:56" string(19) "2015-10-12 21:38:56"
Output for 5.2.13 - 5.2.16
string(19) "2015-10-12 21:38:57" string(19) "2015-10-12 21:38:57"
Output for 5.2.8 - 5.2.12
string(19) "2015-10-12 21:38:58" string(19) "2015-10-12 21:38:58"
Output for 5.2.2 - 5.2.7
string(19) "2015-10-12 21:38:59" string(19) "2015-10-12 21:38:59"
Output for 5.2.0 - 5.2.1
string(19) "2015-10-12 21:39:00" string(19) "2015-10-12 21:39:00"
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/nSiNe on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/nSiNe on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/nSiNe on line 3