function timestampToTime(timestamp, delimiter = "-") {
  const date = new Date(timestamp * 1000);
  const Y = date.getFullYear() + delimiter;
  const M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1) + delimiter;
  const D = (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  const h = (date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
  const m = (date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes());
  return Y + M + D + h + m;
}

const timeUtil = {
  timestampToTime,
};

export default timeUtil;