The date() function formats a local date and time, and returns the formatted date string.
Basically uses of The date() function formats a local date and time.
The date() function returns the formatted date string.
syntex of date () function
date(format,timestamp);
you can see belloe example:
<?php
//now call date () for printing the current day
echo date("l") . "<br>";
//now call date () for printing the current day, current time, AM or PM
echo date("l h:i:s A") . "<br>";
// now call date () for printing the current day, current date,current month,current year, current time, AM or PM
echo date("l jS \of F Y h:i:s A") . "<br>";
?>
output will come following:
1- When we will print date("l"), then output will come
Friday
2-When we will print date("l h:i:s A"), then output will come
Friday 02:47:42 AM
3-When we will print date("l h:i:s A"), then output will come
Friday 27th of November 2015 02:47:42 AM
0 Comment(s)