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 :
[ 0 ] Comments