3v4l.org

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