/* converts given number of seconds to standard time display format
 * http://goo.gl/kEvnKn
 */
function convertToTime(number) {
  const mins = Math.floor(number / 60);
  const secs = (number % 60).toFixed();
  return `${mins < 10 ? '0' : ''}${mins}:${secs < 10 ? '0' : ''}${secs}`;
}

export default convertToTime;

/* converts given number of seconds to standard time display format
 * http://goo.gl/kEvnKn
 */
function convertToTime(number) {
  const hours = Math.floor(number / (60 * 60));
  const mins = Math.floor(number / 60) - hours * 60;
  const secs = (number % 60).toFixed();
  let time = hours > 0 ? `${hours}:` : '';
  time += `${mins < 10 && hours > 0 ? '0' : ''}${mins}:`;
  time += `${secs < 10 ? '0' : ''}${secs}`;
  return time;
}

export default convertToTime;

Improve timestamp formatting.