Return the current time as a Unix timestamp, then format it to a date:
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
by გიორგი ბაკაშვილი
4 years ago
PHP
Date
PHP official doc
2
Pro tip: use ```triple backticks around text``` to write in code fences