timestamp() php code example
Example 1: php time
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
Example 2: php date
$dateTime = new \DateTime();
/**
* You can get the string by using format
*/
$dateTime->format('Y-m-d H:i:s');
<?php
$t=time();
echo($t . "<br>");
echo(date("Y-m-d",$t));
?>
$dateTime = new \DateTime();
/**
* You can get the string by using format
*/
$dateTime->format('Y-m-d H:i:s');