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.

57 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