Posted By:
16 Mar, 2014 3:09 am PDT

date function in PHP

How to display date in PHP?

We have built –in date() function in PHP which has two parameters format and timestamp.

SYNTAX:

date(format , timestamp);

»Format  parameter specifies format of the date/time and timestamp parameter is optional.Default time stamp is current time and date.

 

//Program to show how to use date() function

 

<html>

<body>

<?php

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

echo date("Y.m.d");

?>

</body>

</html>

 

/*Output of the above program is:

2014/03/05

2014/03/05

*/

Attachment:None


date function in PHP .This shows how user can use date function in Php and display date.

Attachment: date.php
Was it useful?  




Please login to reply to this problem.