Create a PHP script that prints the current date and time.

<?php
echo "Current Date and Time: " . date("Y-m-d H:i:s");
?>
  • The script uses the date function to get the current date and time.
  • The format "Y-m-d H:i:s" represents the year, month, day, hour, minute, and second.

Post your Answer