Timer in javascript

Discussion in 'JavaScript and AJAX' started by unni krishnan.r, Jun 1, 2010.

  1. unni krishnan.r

    unni krishnan.r Member

    Joined:
    Apr 20, 2010
    Messages:
    209
    Likes Received:
    4
    Trophy Points:
    18
    Occupation:
    education
    Location:
    Kerala
    Home Page:
    http://blogofunni.blogspot.com
    I fount a user asking for timer in javascript it is for him/her
    Code:
    <script type="text/javascript">
    var current Time=new Date()
    var hours=current Time.hours()
    var minutes=current Time.minutes()
    if (minutes<10)
    minutes="0"+minutes
    document.write(hours+":"+minutes)
    if(hours>11)
    {
    document.write("P.M")
    }
    else
    {
    document.write("A.M")
    }
    </script>
    
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    389
    Trophy Points:
    83
    If you can't find the thread you can use the search option at the top of the page.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice