PHP date get current year

PHP date get current year


Posted in : PHP Posted on : January 25, 2011 at 6:37 PM Comments : [ 0 ]

In this tutorial you will learn how to PHP date get current year in a PHP web application.

PHP date get current year

In this tutorial you will learn how to PHP date get current year in a PHP web application. The  date() function return current date and  date("Y",strtotime($date)) that return year in four number. The code of "php-date-get-current-year.php"  given below :

<?php
$date =date('Y-m-d');
echo "Current date :: ".$date."<br>";
$month =date("Y",strtotime($date));
echo " Current year : ".$month;
?>

Output :

When run "php-date-get-current-year.php"  display output as :

Download Source Code

Go to Topic «PreviousHomeNext»

Your Comment:


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

 
Tutorial Topics