export const timeFormatDate = (timestamp) => {
const time = new Date(parseInt(timestamp * 1000));
const year = time.getFullYear();
const month = time.getMonth() + 1;
const date = time.getDate();
const hours = time.getHours();
const minutes = time.getMinutes();
const seconds = time.getSeconds();
return `${year}年${month < 10 ? `0${month}` : month}月${date < 10 ? `0${date}` : date
}日${hours < 10 ? `0${hours}` : hours}:${minutes < 10 ? `0${minutes}` : minutes
}:${seconds < 10 ? `0${seconds}` : seconds}`;
}
时间戳格式转换为x 年x 月x 日x 时x 分x 秒
于 2023-02-16 14:52:46 首次发布