TO DISPLAY THE CURRENT DATE
$current_date = date("Y-m-d");
echo $current_date;
?>
OUTPUT
If you want to show current date with Hours, Minutes and Seconds.
Then try the following code.
$current_date = date("Y-m-d H:i:s");
echo $current_date;
?>
OUTPUT
If you want to change the current date format, please check the following
Code
$current_date = date("M d, Y");
echo $current_date;
?>
OUTPUT
Please check the following format table which is used with date.
Leave a comment