PHP does not refresh on the page so You can initialize your javascript with the server date:
<?php
date_default_timezone_set('America/Sao_Paulo');
?>
<div class="date">BR, <span id="server_time"></span></div>
<script>
var server_time = document.getElementById("server_time");
var now = new Date(<?=date('Y')?>, <?=date('m')-1?>, <?=date('d')?>, <?=date('H')?>, <?=date('i')?>, <?=date('s')?>, 0);
window.setInterval(function(){
now.setSeconds(now.getSeconds() + 1);
server_time.innerHTML = now.getDate() + "/" + (now.getMonth() + 1 )+ "/" + now.getFullYear() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();
},1000);
</script>
Why I didn’t put the date inside the new Date(), because what works on Chrome doesn’t work firefox, in which case it will always work on both.
You can improve the code to show 0, so it would look 03:03:03 and not 3:3:3.
Maybe the best solution is to use javascript. With php, you’ll have to update every time anyway.
– user28595
If you don’t want to use javascript (but don’t have any advantage in doing so), put that time inside an iframe and at the head of that iframe page you use a meta refresh. But the cool is with javscript itself, which then counts the seconds too, is dynamic. Much better than with php only.
– Vítor André