Description:
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:
d - Represents the day of the month (01 to 31)
m - Represents a month (01 to 12)
Y - Represents a year (in four digits)
The example below formats today's date in three different ways:
Code:
<?php
echo date("Y/m/d")."<br>";
echo date ("Y.m.d")."<br>";
echo date ("Y-m-d");
?>
output:
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:
d - Represents the day of the month (01 to 31)
m - Represents a month (01 to 12)
Y - Represents a year (in four digits)
The example below formats today's date in three different ways:
Code:
<?php
echo date("Y/m/d")."<br>";
echo date ("Y.m.d")."<br>";
echo date ("Y-m-d");
?>
output:
No comments:
Post a Comment