Create a true clock
-
I want there to be an actual clock on my webpage. I figured out the basic php to get the local time for the reader and or th server time. but what i really need is a way for this to keep updating (maybe AJAX or something?) with out reloading the page. the final product would a small digital clock on the side of the page.
I am making a small plugin out of this just so the code is easily maintainable
inside the plugin is the following
function nattime() {
$now = localtime( );
print “$now[2]:$now[1]:$now[0]
“;
}and in my page
<div class=”blox”>The Time is Currently
<?php nattime() ?>
</div>any help to make the time update more frequently then a full page refresh would be helpful
The topic ‘Create a true clock’ is closed to new replies.