Answers for "print current time in php"

PHP
2

php current time

echo date('Y-m-d H:i:s');

//Output something like this:
//2021-07-30 10:07:45
Posted by: Guest on July-30-2021
1

php current time

# Current Time
date_default_timezone_set("America/New_York");
echo "The time is " . date("h:i:sa");
Posted by: Guest on March-03-2021
2

php get current time and date

date("Y-n-j G:i:s");
//-->2020-10-29 23:27:15
Posted by: Guest on October-29-2020

Browse Popular Code Answers by Language