笔记时间不一样

This commit is contained in:
zhaofang
2022-10-28 15:09:09 +08:00
parent 931dfcc7fb
commit 15feb57769
3 changed files with 12 additions and 11 deletions

View File

@@ -440,3 +440,10 @@ export function formatSecondToHour(second) {
h = h.toFixed(n);
return h;
}
// 秒换成时分秒
export function getHMS(time) {
const hour = parseInt(time / 3600) < 10 ? '0' + parseInt(time / 3600) : parseInt(time / 3600)
const min = parseInt(time % 3600 / 60) < 10 ? '0' + parseInt(time % 3600 / 60) : parseInt(time % 3600 / 60)
const sec = parseInt(time % 3600 % 60) < 10 ? '0' + parseInt(time % 3600 % 60) : parseInt(time % 3600 % 60)
return hour + ':' + min + ':' + sec
}