<commit_before>/* export function formatTime(seconds) {
  // https://stackoverflow.com/a/25279340/4208724
  const date = new Date(null);
  date.setSeconds(seconds);
  const result = date.toISOString().substr(11, 8);
  return result;
} */

export function formatDate(date) {
  const newDate = new Date(date);
  const parsedDate = `${newDate.getDate()}/${newDate.getMonth() +
    1}/${newDate.getFullYear()}`;
  return parsedDate;
}

export function formatTime(number) {
  const secNum = parseInt(number, 10);
  let hours = Math.floor(secNum / 3600);
  let minutes = Math.floor((secNum - hours * 3600) / 60);
  let seconds = secNum - hours * 3600 - minutes * 60;

  if (hours < 10) {
    hours = `0${hours}`;
  }
  if (minutes < 10) {
    minutes = `0${minutes}`;
  }
  if (seconds < 10) {
    seconds = `0${seconds}`;
  }
  const time = `${hours}:${minutes}:${seconds}`;
  return time;
}
<commit_msg>display time with words now<commit_after>/* export function formatTime(seconds) {
  // https://stackoverflow.com/a/25279340/4208724
  const date = new Date(null);
  date.setSeconds(seconds);
  const result = date.toISOString().substr(11, 8);
  return result;
} */

export function formatDate(date) {
  const newDate = new Date(date);
  const parsedDate = `${newDate.getDate()}/${newDate.getMonth() +
    1}/${newDate.getFullYear()}`;
  return parsedDate;
}

export function formatTime(number) {
  const secNum = parseInt(number, 10);
  const hours = Math.floor(secNum / 3600);
  const minutes = Math.floor((secNum - hours * 3600) / 60);
  const seconds = secNum - hours * 3600 - minutes * 60;

  const hoursString = hours === 1 ? `${hours} hour` : `${hours} hours`;
  const minutesString =
    minutes === 1 ? `${minutes} minute` : `${minutes} minutes`;

  if (hours === 0 && minutes === 0 && seconds > 0) {
    return `${seconds} seconds`;
  } else if (hours === 0 && minutes > 0) {
    return `${minutesString}`;
  } else if (hours > 0 && minutes > 0) {
    return `${hoursString} ${minutesString}`;
  }

  return 0;
}

{'fraction_non_alphanumeric': 0.1717821782178218, 'fraction_numerical': 0.04603960396039604, 'mean_word_length': 3.635321100917431, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '478360', 'n_tokens_mistral': 753, 'n_tokens_neox': 686, 'n_words': 175}