ok lets say we have a website that need a realtime time;
example :
<div id="updatetime">21:12:52</div>
each seconds update hours:m:second.
what i have in minds using the interval function to do long pool and add the sec +1 if to 60 then add + 1 to m and same as hours. but is there a function already solving this problem?
how do you make this 21:12:52 a moving real clock with javascript that updates each seconds?
i have search google, stackoverflow, many of them tells us how to make the current real time datetime from javascript. but none from an existing time. if there is please do insert the link.
It can be as easy as this:
Or use the other Date methods to fine-tune your output.
Update
I only now realized that OP was asking not about incrementing an element with the current time but with a predetermined time.
That’s less trivial, but here is a solution that should fit the original question: