<?php
// set the default timezone to use. Available since PHP 5.1
date_default_timezone_set('Etc/GMT+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));
?>
ThursdayThursday 2nd of April 2015 03:08:15 AMJuly 1, 2000 is on a SaturdayThu, 02 Apr 2015 03:08:15 -05002000-07-01T00:00:00-05:00
Output for 5.1.1 - 5.1.2
ThursdayThursday 2nd of April 2015 03:08:15 AMJuly 1, 2000 is on a SaturdayThu, 02 Apr 2015 03:08:15 -05002000-07-01T00:00:00-0500
Output for 5.1.0
ThursdayThursday 2nd of April 2015 03:08:15 AMJuly 1, 2000 is on a Saturday
Notice: Use of undefined constant DATE_RFC2822 - assumed 'DATE_RFC2822' in /in/3HWN0 on line 17
ThuAMGMT+5E_RAprilC2822
Notice: Use of undefined constant DATE_ATOM - assumed 'DATE_ATOM' in /in/3HWN0 on line 20
SatAMGMT+5E_AMGMT+5-0500Jul
Output for 5.0.0 - 5.0.5
Fatal error: Call to undefined function date_default_timezone_set() in /in/3HWN0 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/3HWN0 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: date_default_timezone_set() in /in/3HWN0 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/3HWN0 on line 3