How to display time?

Discussion in 'PHP' started by qualityhostings, Sep 8, 2008.

  1. #1
    Hello

    I have been searching for this code, but I didnt find it anywhere.
    I am looking for applying this code in a project.

    I want to display the time , and if possible it should change on each second.
    What I mean is , just like a digital clock.

    Anybody know the code ?

    Thanks
    Vivek
     
    qualityhostings, Sep 8, 2008 IP
  2. ariefdisolo

    ariefdisolo Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you need a Javascript or flash to do this.
    You can set the time either based on server time or client's.
     
    ariefdisolo, Sep 8, 2008 IP
  3. nabz245

    nabz245 Well-Known Member

    Messages:
    677
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    110
    #3
    nabz245, Sep 8, 2008 IP
  4. tonyrocks

    tonyrocks Active Member

    Messages:
    1,574
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    88
    #4
    Javascript rocks, but you could also be silly and do a PHP location directive that will refresh the page every seconds and display the current time with each refresh.
     
    tonyrocks, Sep 8, 2008 IP
  5. qualityhostings

    qualityhostings Well-Known Member

    Messages:
    1,764
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Thank you for the suggestions. Actually I haven't thought about javascript.
    I'll check it now.

    Regards
     
    qualityhostings, Sep 8, 2008 IP
  6. Kevin Design

    Kevin Design Guest

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    For the updated seconds you'll be using javascript but if you just want a static time in PHP have a look at the date() function - it's pretty easy to use.
     
    Kevin Design, Sep 9, 2008 IP