PHP Date and time
The PHP date() function formats a timestamp to a more readable date and time.
Get a Date
The required format parameter of the date() function specifies how to format the date (or time).
Here are some characters that are commonly used for dates:
The example below formats today's date in three different ways:
<?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"); ?>
In next chapter we will learn date and time function
Share this page on :
© 2022 AnalyzeCode.com All rights reserved.