3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $now = new DateTimeImmutable("now", new DateTimeZone('UTC')); $now = new DateTime($now->format('c')); var_dump($now->format('H:i:s')); $now->setTimezone(new DateTimeZone('Europe/London')); var_dump($now->format('H:i:s'));
based on n0Es1
Output for 5.6.28, 7.0.20 - 7.2.0
string(8) "13:33:26" string(8) "14:33:26"
Output for 7.0.6
string(8) "06:20:28" string(8) "07:20:28"
Output for 7.0.5
string(8) "19:17:03" string(8) "20:17:03"
Output for 7.0.4
string(8) "06:35:42" string(8) "06:35:42"
Output for 7.0.3
string(8) "07:08:53" string(8) "07:08:53"
Output for 7.0.2
string(8) "12:54:08" string(8) "12:54:08"
Output for 7.0.1
string(8) "17:56:40" string(8) "17:56:40"
Output for 7.0.0
string(8) "19:33:27" string(8) "19:33:27"
Output for 5.6.21
string(8) "01:40:22" string(8) "02:40:22"
Output for 5.6.20
string(8) "18:09:44" string(8) "19:09:44"
Output for 5.6.19
string(8) "14:42:46" string(8) "14:42:46"
Output for 5.6.18
string(8) "22:28:45" string(8) "22:28:45"
Output for 5.6.17
string(8) "11:27:09" string(8) "11:27:09"
Output for 5.6.16
string(8) "20:19:24" string(8) "21:19:24"
Output for 5.6.15
string(8) "21:12:16" string(8) "22:12:16"
Output for 5.6.14
string(8) "23:46:19" string(8) "00:46:19"
Output for 5.6.13
string(8) "03:41:47" string(8) "04:41:47"
Output for 5.6.12
string(8) "17:19:48" string(8) "18:19:48"
Output for 5.6.11
string(8) "00:20:34" string(8) "01:20:34"
Output for 5.6.10
string(8) "02:09:47" string(8) "03:09:47"
Output for 5.6.9
string(8) "07:07:23" string(8) "08:07:23"
Output for 5.6.8
string(8) "15:08:20" string(8) "16:08:20"
Output for 5.6.7
string(8) "09:51:26" string(8) "10:51:26"
Output for 5.5.35
string(8) "05:22:20" string(8) "06:22:20"
Output for 5.5.34
string(8) "20:33:41" string(8) "21:33:41"
Output for 5.5.33
string(8) "17:31:52" string(8) "17:31:52"
Output for 5.5.32
string(8) "00:19:59" string(8) "00:19:59"
Output for 5.5.31
string(8) "14:13:53" string(8) "14:13:53"
Output for 5.5.30
string(8) "23:20:36" string(8) "00:20:36"
Output for 5.5.29
string(8) "17:46:53" string(8) "18:46:53"
Output for 5.5.28
string(8) "20:25:36" string(8) "21:25:36"
Output for 5.5.27
string(8) "22:56:21" string(8) "23:56:21"
Output for 5.5.26
string(8) "04:35:37" string(8) "05:35:37"
Output for 5.5.25
string(8) "10:39:02" string(8) "11:39:02"
Output for 5.5.24
string(8) "17:35:07" string(8) "18:35:07"
Output for 5.3.18 - 5.4.45
Fatal error: Class 'DateTimeImmutable' not found in /in/s3u2J on line 4
Process exited with code 255.