Hmmm ... the problem is that PHP is executed server-side, and Javascript is executed client-side.
One solution would be to use a meta tag to force the page to refresh. And if you're going to do that, there's probably no point in using Javascript.
Maybe someone else has a better idea.
P.S. What's the point of this, anyway? Why do users want to see a continuously updated server-time display?