title: is it possible to find the ETA of a html 5 file upload?
body: <p>i have a html5 file upload script on my site.</p>
  
  <p>it works fine with this progressbar script</p>
  
  <pre><code>xhr.upload.addEventListener("progress", function(e) {
              var pc = parseInt(100 - (e.loaded / e.total * 100));
              var pci = parseInt(e.loaded / e.total * 100);
              //get us our ETA
              //kilobytes or megabytes?
              var pcia = e.loaded / 1024;
              var pcia2 = e.total / 1024;
              if (pcia2 &gt; 1024)
              {
                  pcia = pcia / 1024
                  pcia2 = pcia2 / 1024;
                  progress.style.backgroundPosition = pc + "% 0";
                  elapsedtime = startTime + new Date();
                  alert(startTime);alert(new Date());
                  var eta = ((e.total / e.loaded) * elapsedtime) - elapsedtime;
              progress.innerHTML = pci + "% (" + Math.ceil(pcia * 100)/100 + " MB of " + Math.ceil(pcia2 * 100)/100 + " MB)-(" + eta +" secs. remaining)";
              }
              else
              {
                  progress.style.backgroundPosition = pc + "% 0";
              progress.innerHTML = pci + "% (" + Math.ceil(pcia * 100)/100 + " KB of " + Math.ceil(pcia2 * 100)/100 + " KB)-(" + eta +" secs. remaining)";
              }
          }, false);
  </code></pre>
  
  <p>ok, so i have alerted the start time and the time when the progress is called.
  But the variable ETA shows as NaN.
  How can you achieve something like date("Y-m-d H:i:s"); (from php) in javascript?</p>