title: javascript - time counter since start date and time
body: <p>I have a new business, where I just hired someone to work for me, I am trying to make it easy for her to track her time, so I created a clock in button, that creates a record in a database, I have it pop up a small window, that she can click to clockout when she is done working.</p>
  
  <p>I want it to show her on that popup window a counter that will show how long she has been working, so I want to create a javascript or jQuery that will start at a certain time and count from there. She is on the East Coast, our company is in the Central Timezone, so 1 hour behind her.</p>
  
  <p>How can I get a javascript to start from a certain time and keep updating the timer, so she can see something like this:</p>
  
  <p>[You've been working for: 01:01:01 HH::MM::SS] - and it is actively updating, climbing up.</p>
  
  <p>All the timers I've found are not about time itself, but about starting at a time and counting down, or starting at 0 and counting up.</p>
  
  <p>Is there a way to tell it a start time, so that way if she reloads the page, it does not start from 0, but will start at the time she clocked in, then add the time since and start from there?</p>
  
  <p>I know it can be done, but I'm more of a Perl guy than a Javascript guy. I'm doing this on Wordpress, so I could use PHP and just tell her to refresh the page to see the current amount of time and then have it on page load show the current amount of time, but I think having a counter would be better and make it easier for her.</p>
  
  <p>is there some code already done that I could modify myself to make it work? I cannot find any, anywhere. I'm willing to do all the work, I'm not asking for someone to do it for me.</p>
  
  <p>I found this example someone did:</p>
  
  <pre><code>function get_uptime() {
   var t1 = new Date()
   var t2 = new Date()
   var dif = t1.getTime() - t2.getTime()
  
   seconds = dif / 1000;
   Seconds_Between_Dates = Math.abs(seconds);
   document.getElementById("seconds").innerHTML = Seconds_Between_Dates;
   setTimeout(get_uptime, 1000);
  }
  
  get_uptime();
  </code></pre>
  
  <p>That is sort of it, but I don't now how to put the first time in t1, what format do I put it in?
  I can have PHP put it in any format, but not sure the one it needs.
  Plus this appears to only put the seconds, not hours, minutes and seconds.</p>
  
  <p>Is there away to do that?</p>
  
  <p>Thanks,
  Richard</p>