PHP Date() Function

The PHP date() function is used to format a time and/or date.

date(format,timestamp)

The required format parameter in the date() function specifies how to format the date/time.

Here are some characters that can be used:

* d – Represents the day of the month (01 to 31)
* m – Represents a month (01 to 12)
* Y – Represents a year (in four digits)

<?php
echo date("Y/m/d"); echo "<br />";
echo date("Y.m.d"); echo "<br />";
echo date("Y-m-d");
?>

The output of the code above could be something like this:
2011/05/23
2011.05.23
2011-05-23

For more date format refer this link http://in2.php.net/manual/en/function.date.php

Posted in Php