How to use date in PHP
In this article I am going to explain about use of date function in PHP.
PHP Date() function
The php date function allow programmer or developers to manipulate date in easy way.
Syntax of PHP date function
Parameters in date function
Format of the date function
There are following format of date function
Format character |
Description |
d |
Day of the month, 2 digits with leading zero.(01 to 31) |
m |
Numeric representation of a month,with leading zero (01 to 12) |
Y |
A full numeric representation of a year,4 digit (four digit) |
Example of date function
<html>
<head>
<body>
<?php
echo date("Y/m/d") . "<br />";
echo date("Y.m.d") . "<br />";
echo date("Y-m-d");
?>
</body>
</head>
</html>
|
Output:
You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here