Before displaying the current time, make sure your PHP environment is set to the correct time zone. You can use the date_default_timezone_set() function to set the time zone. For example, to set the time zone to "Asia/Shanghai":
date_default_timezone_set("Asia/Shanghai");
echo date("Y-m-d H:i:s");
?>
This ensures that the time Digital Marketing displayed is the local time, not the server's default time zone.

Dynamically display the current time
Sometimes, you may want the page to automatically refresh to show the latest time. This can be achieved by combining PHP and JavaScript. Here is a simple example that uses JavaScript to update the displayed time every second: