1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Timer in javascript

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

  1. unni krishnan.r

    unni krishnan.r New Member

    Joined:
    Apr 20, 2010
    Messages:
    204
    Likes Received:
    3
    Trophy Points:
    0
    Occupation:
    education
    Location:
    Kerala
    Home Page:
    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,292
    Likes Received:
    365
    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