mktime() Return the timestamp for a date and Time. Then use it to find the Date and Time of that date.


<?php

$dt=mktime(1, 21, 12, 8, 12, 2021);

echo "Created date is " . date("Y-m-d h:i:sa", $dt);

?>


Output : 


Created date is 2021-04-27 11:14:54am


How To Make Date and Time in PHP