Common time formatting usage// Set the default time zone to be used. Available since PHP 5.1 <br>
date_default_timezone_set('UTC');<br>
<br>
// Output is similar to: Saturday<br>
echo date("l");<br>
<br>
// Output is similar: Saturday 26th of November 2016 10:12:46 PM<br>
echo date('l dS of F Y h:i:s A');<br>
<br>
// Output: November 26, 2016 is on a Saturday<br>
echo "November 26, 2016 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2016));<br>
<br>
/* Use constants in format parameters */<br>
// Output is similar: Mon, 15 Aug 26 10:20:16 +0800<br>
echo date(DATE_RFC822);<br>
<br>
// Output is similar: 2016-11-26T00:00:00+00:00<br>
echo date(DATE_ATOM, mktime(0, 0, 0,11,26, 2016));<br>
<br>
//Print out the current date<br>
echo date('Y year m month d day');<br>
<br>
//Formatting time has passed<br>
echo date('Y year m month d day', strtotime('2016-11-26'));