Support » Plugins » Create a true clock

  • Resolved icco


    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() ?>

    any help to make the time update more frequently then a full page refresh would be helpful

Viewing 4 replies - 1 through 4 (of 4 total)
  • Lots of scripts out there for real time clocks. Try some of the script sites. Why reinvent the wheel?

    Actually, I think Viper might have a plugin for you:

    aww. but reinventing the wheel is so fun. To be honest i just had trouble finding a good script that would work. Vipers plugin is sorta the idea i had but not really, i’ll keep looking

    Heh. Yeah, I understand that as far as it goes. I know I’ve seen some “constant-update” scripts on sites like dynamic drive and hotscripts.

    [Of course, if everyone is using a current OS of any sort, they all have a current realtime clock anyway….]

    ya, but this is mainly for me, when i am working or browsing the web i don’t look at my clock, but if a clock is on the page i can realize if i need to stop.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Create a true clock’ is closed to new replies.