title: Having an issue with displaying time left to a school class
body: <p>I have a problem with this code: </p>
  
  <pre><code>    &lt;script&gt;
  
  function timeCounter(){
  
  public var endtime = [29700000, 32400000, 36000000, 38700000, 44100000, 46800000, 53100000];
  
  public var currentTime = new Date(n.getFullYear(), n.getMonth(), n.getDate(), n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds());
  
  public var miliseconds = 1;
  
  public var seconds = miliseconds * 1000;
  
  public var minutes = seconds * 60;
  
  public var hours = minutes * 60;
  
  public var days = hours * 24;
  
  public var years = days * 365;
  
  
  
  public var numYears = Math.floor(diff / years);
  
  public var numDays = Math.floor((diff % years) / days);
  
  public var numHours = Math.floor((diff % days) / hours);
  
  public var numMinutes = Math.floor((diff % hours) / minutes);
  
  public var numSeconds = Math.round((diff % minutes) / seconds);
  
  
  
   }
  
    &lt;/script&gt;
  </code></pre>
  
  <p>and I want to invoke it in a table like this:</p>
  
  <pre><code> &lt;tr&gt;
      &lt;td&gt; 08:15-09:00 &lt;/td&gt;
  
      &lt;td&gt; 
  
      &lt;script&gt;
  
      document.getElementById("t01").innerHTML = numYears;
  
      setInterval(countDown(endtime), 1000);
  
      var diff = (document.getElementById("demo").innerHTML = endtime[0]); - currentTime;
  
           document.write("Time left to next class: " (diff / 3600000); " hours and " (diff / 60000); " minutes.");
  
      &lt;/script&gt;
  
      &lt;/td&gt;
  
    &lt;/tr&gt;
  </code></pre>
  
  <p>What am I doing wrong??</p>