Date Function in PHP

Hi. This is display  a current date(today date)  and u can change format to this date example:(Y/m/d),(m/Y/d),(d/Y/m). This is user friendly format and  give  (Y) is  capital letter  it display full year otherwise it display  last two number.

  d -  Day of the month, 2 digits with leading zeros     01 to 31.
  m -  Numeric representation of a month, with leading zeros     01 through 12.
  Y -   A full numeric representation of a year, 4 digits     Examples: 2002or 2013.Y  -
  y -   A full numeric representation of a year,  last 2 digits    Examples: 02 or 13.

syntax:

   
date("d/m/Y");

     ex:7/2/2013

date("d/m/y");
      7/2/13

Source Code:

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

 

Output:


     7/2/2013

No comments:

Post a Comment