3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // set the default timezone to use. Available since PHP 5.1 date_default_timezone_set('UTC+5'); // Prints something like: Monday echo date("l"); // Prints something like: Monday 8th of August 2005 03:12:46 PM echo date('l jS \of F Y h:i:s A'); // Prints: July 1, 2000 is on a Saturday echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000)); /* use the constants in the format parameter */ // prints something like: Wed, 25 Sep 2013 15:28:57 -0700 echo date(DATE_RFC2822); // prints something like: 2000-07-01T00:00:00+00:00 echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000)); ?>
based on sGqFd
Output for 5.1.3 - 7.2.0
Notice: date_default_timezone_set(): Timezone ID 'UTC+5' is invalid in /in/jEjo5 on line 3 ThursdayThursday 2nd of April 2015 10:07:31 AMJuly 1, 2000 is on a SaturdayThu, 02 Apr 2015 10:07:31 +02002000-07-01T00:00:00+02:00
Output for 5.1.2
Notice: date_default_timezone_set(): Timezone ID 'UTC+5' is invalid in /in/jEjo5 on line 3 ThursdayThursday 2nd of April 2015 10:07:31 AMJuly 1, 2000 is on a SaturdayThu, 02 Apr 2015 10:07:31 +02002000-07-01T00:00:00+0200
Output for 5.1.1
Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 7 Thursday Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 10 Thursday 2nd of April 2015 08:07:31 AM Notice: mktime(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 13 Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 13 July 1, 2000 is on a Saturday Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 17 Thu, 02 Apr 2015 08:07:31 +0000 Notice: mktime(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 20 Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 20 2000-07-01T00:00:00+0000
Output for 5.1.0
Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 7 Thursday Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 10 Thursday 2nd of April 2015 08:07:31 AM Notice: mktime(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 13 Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 13 July 1, 2000 is on a Saturday Notice: Use of undefined constant DATE_RFC2822 - assumed 'DATE_RFC2822' in /in/jEjo5 on line 17 Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 17 ThuAMUTCE_RAprilC2822 Notice: Use of undefined constant DATE_ATOM - assumed 'DATE_ATOM' in /in/jEjo5 on line 20 Notice: mktime(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 20 Notice: date(): Timezone setting (date.timezone) or TZ environment variable contains an unknown timezone in /in/jEjo5 on line 20 SatAMUTCE_AMUTC+0000Jul
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/jEjo5 on line 3
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: date_default_timezone_set() in /in/jEjo5 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/jEjo5 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: date_default_timezone_set() in /in/jEjo5 on line 3