echo date php code example
Example 1: php get current year
$currentYear=date("Y");//2019
Example 2: php get date
date("Y-m-d h:i:sa")
Example 3: php code to display current date and time in different formats
echo date('Y.m.d H:i:s');
Example 4: show date php
check here link: http://www.eltcalendar.com/stuff/datemysqlphp.html