Show clock/time increment from javascript

I tried to show/increment the only time(Hours, Minutes and Seconds) like a timer from getting server side, but it’s not working for me.

For this I tried below code.

Can you please help me to run the specified time (Server Time) to run as Timer.

What I have tried:

c#

ScriptManager.RegisterStartupScript(Page, this.GetType(), "close", "OnRunnTimer("+0.21023+");", true);

// JS COde

//Server time I am sending serverTimeP = 0.21023

function OnRunnTimer(timeP) { 
            setInterval(function () { runJSTimer(timeP); }, 1000);
        }

 function runJSTimer(serverTimeP) {

var d = new Date();
              
             d.setHours(serverTimeP);             
            
 
             var hours = d.getHours();
             var min = d.getMinutes();
             var sec = d.getSeconds();
 
             lblJsTimer.SetText(hours + ":" + min + ":" + sec);

}

enter image description here
Can you please help on this.

115 thoughts on “Show clock/time increment from javascript”

  1. First off I would like to say awesome blog! I had a quick
    question that I’d like to ask if you do not mind.
    I was interested to find out how you center yourself and clear your head before writing.
    I’ve had trouble clearing my thoughts in getting my ideas out there.
    I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are
    generally lost just trying to figure out how to begin. Any suggestions or hints?
    Thanks!

    Reply
  2. I’m not sure where you’re getting your info, but good topic.
    I needs to spend some time learning much more or
    understanding more. Thanks for great information I was looking for this information for my mission.

    Reply
  3. My brother suggested I might like this blog. He was entirely right.
    This post actually made my day. You can not imagine simply
    how much time I had spent for this information! Thanks!

    Reply
  4. Hello there, I discovered your website by way of Google at the same time as searching for a similar subject,
    your web site came up, it seems good. I’ve bookmarked it in my google bookmarks.

    Hi there, simply was alert to your weblog via Google, and found that it’s truly informative.
    I’m going to be careful for brussels. I will appreciate in the event you proceed this in future.
    Lots of other folks might be benefited out of your writing.
    Cheers!

    Reply
  5. I’m not sure why but this weblog is loading incredibly slow for me.
    Is anyone else having this issue or is it a problem on my
    end? I’ll check back later on and see if
    the problem still exists.

    Reply
  6. Hi outstanding website! Does running a blog such as this require
    a lot of work? I have very little knowledge of coding but I had
    been hoping to start my own blog in the near future. Anyhow,
    if you have any suggestions or tips for new blog owners
    please share. I understand this is off subject however I just wanted to ask.
    Thanks a lot!

    Reply
  7. Hey there! I know this is kinda off topic but I
    was wondering if you knew where I could locate a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having problems finding
    one? Thanks a lot!

    Reply
  8. We are a group of volunteers and opening a new scheme in our community.
    Your web site provided us with valuable information to work on. You’ve done a formidable
    job and our entire community will be thankful
    to you.

    Reply
  9. I just couldn’t leave your web site before suggesting
    that I really enjoyed the standard info a person provide in your
    guests? Is gonna be again continuously to check up on new
    posts

    Reply
  10. It’s the best time to make a few plans for the longer term
    and it’s time to be happy. I’ve learn this put up and
    if I may I desire to recommend you few attention-grabbing issues or advice.
    Perhaps you can write subsequent articles referring to
    this article. I desire to read even more things approximately it!

    Reply
  11. When someone writes an paragraph he/she maintains the thought
    of a user in his/her mind that how a user can be aware of it.
    So that’s why this piece of writing is amazing.
    Thanks!

    Reply
  12. Hello there! Do you know if they make any plugins to protect
    against hackers? I’m kinda paranoid about losing everything I’ve worked hard on.
    Any suggestions?

    Reply
  13. Amazing blog! Is your theme custom made or
    did you download it from somewhere? A design like yours with a
    few simple tweeks would really make my blog stand
    out. Please let me know where you got your theme. Bless you

    Reply
  14. Hello there! This is my first comment here so I just wanted to give a quick shout out and tell you I truly enjoy
    reading through your articles. Can you suggest any other blogs/websites/forums that deal with the same subjects?

    Appreciate it!

    Reply
  15. Great blog here! Also your website loads up very fast! What host are you using?
    Can I get your affiliate link to your host? I wish my site loaded
    up as quickly as yours lol

    Here is my web blog: raycon

    Reply

Leave a Comment