If you simply want to display the local time from the client, you're better off using JavaScript than PHP (as PHP is executed on the server, JavaScript is executed client-side).
jQuery is an extension of JavaScript, and simplifies a lot of things like element-targeting and setting values, so for this example I'm using jQuery to set the text of the element.
The date
object can be formatted in a number of ways, using toString()
on it is just for demonstration purposes, you can format it however you like using the different getters (see the MDN).
var date = new Date;
$("#myTime").text(date.toString());
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body>
<div id="myTime"></div>
</body>