0

I'm trying to create a simple count up clock function which basically accepts some specific date (the "since date" to count from) and update a div with the count up.

for example: giving the date [15/04/2014 11:00] (while the current date is [15/04/2014 12:13]) should show a countup 01:13:00 which gets update every second.

ive added a code for a start

<html>
<head>
    <script src="http://code.jquery.com/jquery-2.0.2.min.js"></script>
</head>
<body>
<script>
function updateClock (sinceDate)
 {

    ...
    $("#clock").html(...);      
 }

$(document).ready(function()
{
   setInterval('updateClock()', 1000);
});
</script>
    <div id="clock"/>
</body>
</html>
Popokoko
  • 6,413
  • 16
  • 47
  • 58
  • Sorry for that dup, please feel free to close my post. – Popokoko Apr 15 '14 at 09:37
  • I've already voted for that, just waiting for 4 other to do so :-) While it might not be an exact duplicate, you should get yourself familiar with "recursive" `setTimeout` variations or `clearTimeout` for stopping the countdown/up (shouldn't matter which direction). We're happy to help with a more specific question, like errors you're getting in code attempts. – Bergi Apr 15 '14 at 09:40

0 Answers0