The date function in PHP is the one which formats the timstamp to a readable form.
The Syntax of it is as :
date(format,timestamp)
The required format function is to specify the format of the date and the timestamp Specifies default current date and time.
Here are commonly used format specifiers :
d - Day of the month (01 to 31)
m - Month (01 to 12)
Y - Year (in four digits)
example :
<?php
echo "Today is " . date("Y/m/d") . "<br>";
echo "Today is " . date("Y.m.d") . "<br>";
echo "Today is " . date("Y-m-d") . "<br>";
echo "Today is " . date("l");
?>
output
Today is 2015/12/21
Today is 2015.12.21
Today is 2015-12-21
Today is Monday
0 Comment(s)