title: converting time in seconds to HH:MM:SS:FF
body: <p>I am using video player in my ReactJs project.</p>
  
  <p>I get the current time of the player in seconds and I want to convert that time into the <a href="http://www2.d125.org/applied_arts/teched/courses/AV/files/timecode.pdf" rel="nofollow noreferrer"><strong>HH:MM:SS:FF format</strong></a>, where the <code>FF</code> represents a particular frame. </p>
  
  <p>I'm already able to convert a time into the <code>HH:MM:SS</code> format, like this:</p>
  
  <pre><code>secondsToHms = (d) =&gt; {
    d = Number(d);
    var h = Math.floor(d / 3600);
    var m = Math.floor(d % 3600 / 60);
    var s = Math.floor(d % 3600 % 60);
    return ((h &gt; 0 ? h + ":" + (m &lt; 10 ? "00" : "") : "00:") + "0"+ m + ":" + (s &lt; 10 ? "0" : "") + s);
  }
  </code></pre>
  
  <p>Assuming that I have a video that plays at a framerate of 24 frames per second and I'm getting my time eg. like <code>126.2344452</code>, how can I improve my function to also calculate the <code>FF</code> part?</p>