title: Convert timecode to seconds
body: <p>I'm having problems changing a timecode into frames using JavaScript.
  running at 30 fps we get</p>
  
  <pre><code>"00:00:01:00" = 30 frames
  </code></pre>
  
  <p>So far so good, only I check the number of seconds at it gets converted to this:</p>
  
  <p><img src="https://i.stack.imgur.com/llEtC.png" alt="enter image description here"></p>
  
  <p>Firstly Not sure what's going on there?!
  It's been pointed out that I had \f instead of \nf.</p>
  
  <p>Secondly
  The frames returned is incorrect.
  1 minute should be 1800 seconds not 1800000</p>
  
  <p>Bonus points if you can tell me if that's an Ankh or not.</p>
  
  <pre><code>// set the frame rate or Frame Rat as we like to call him
  var frameRat = 30 // fps
  var numOfFrames = 60 // animation frame count
  var animTime = "00:01:00:00" // time code
  
  var a = convertTimeToFrames(animTime, frameRat);
  var result = animTime + " at " + frameRat + " fps\n = " + a + " frames.";
  alert(result);
  
  
  
  function convertTimeCodeToSeconds(timeString, framerate)
  {
  
    var timeArray = timeString.split(":");
    var hours   = timeArray[0] * 60 * 60;
    var minutes = timeArray[1] * 60;
    var seconds = timeArray[2];
    var frames  = timeArray[3]*(1/framerate);
    var str = "h:" + hours + "\nm:" + minutes + "\ns:" + seconds + "\f:" + frames;
    alert(str)
    var totalTime = hours + minutes + seconds + frames;
  
    //alert(timeString + " = " + totalTime)
    return totalTime;
  }
  
  function convertTimeToFrames(timeString, framerate)
  {
    var secs = convertTimeCodeToSeconds(timeString, framerate);
    return secs * framerate;
  }
  </code></pre>