// 时间戳转时间
export const transformTime = (str) => {
  const n = parseInt(str);
  const D = new Date(n);
  const year = D.getFullYear(); //四位数年份
  let month = D.getMonth() + 1; //月份(0-11),0为一月份
  month = month < 10 ? '0' + month : month;
  let day = D.getDate(); //月的某一天(1-31)
  day = day < 10 ? '0' + day : day;
  let hours = D.getHours(); //小时(0-23)
  hours = hours < 10 ? '0' + hours : hours;
  let minutes = D.getMinutes(); //分钟(0-59)
  minutes = minutes < 10 ? '0' + minutes : minutes;
  const now_time = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes;
  return now_time;
};
