3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $myTime = new DateTime('now', new DateTimeZone('Europe/London')); echo $myTime->format('r')."\n"; $myTime->setTimeZone(new DateTimeZone('Asia/Calcutta')); echo $myTime->format('r');
Output for 7.0.14 - 7.1.0
Wed, 18 May 2016 18:45:09 +0100 Wed, 18 May 2016 23:15:09 +0530
Output for 5.2.0 - 5.5.1, 5.5.3 - 7.0.7
Fri, 03 Jan 2014 19:16:24 +0000 Sat, 04 Jan 2014 00:46:24 +0530
Output for 5.5.2
Fri, 03 Jan 2014 19:16:25 +0000 Sat, 04 Jan 2014 00:46:25 +0530
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/F9O5d 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/F9O5d 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/F9O5d on line 3