Many times we like to use js to get the date and time, but this is only on the client side.
We can use PHP’s date function to get the time on the server:
Copy the code The code is as follows:
//Set the time zone to China
date_default_timezone_set("PRC");
echo date("Y-m-d l H:i:s A");
//Example output :2010-03-06 Saturday 11:51:29 AM
?>
http://www.bkjia.com/PHPjc/327502.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327502.htmlTechArticleMany times we like to use js to get the date and time, but this is only on the client side. We can use PHP's date function to get the time on the server: Copy the code The code is as follows...