Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Simple server-time clock?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35131
    AustinP
    Participant

    Hi everyone,
    I’ve been searching for a way to add a clock to my website for a long time and haven’t found any quality solutions. What I need is a clock that says the server time, in a simple 0:00 PM or AM format. What is the best code to use for this? I know I’ll have to use PHP, but I just need the code. Thanks so much. :D

    Austin

    #90517
    standuncan
    Member

    http://li.php.net/manual/en/function.date.php

    http://li.php.net/manual/en/function.time.php

    I’m not great at php, but I would try something like this:

    php:



    $time = date('H:i:s'); // need to change to whichever format you wish to use.
    ?>

    html:



    The current time is:



Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.