This commit is contained in:
2024-01-23 16:39:15 +08:00
parent 7337905cbc
commit dc347f8aa5
2 changed files with 15 additions and 17 deletions

View File

@@ -67,11 +67,9 @@ export function duration(
}
export function secondsToDuration(seconds: number): string {
const epoch = new Date(0)
const secondsAfterEpoch = new Date(seconds * 1000)
const duration = intervalToDuration({
start: epoch,
end: secondsAfterEpoch,
start: 0,
end: seconds * 1000,
})
return [duration.hours, duration.minutes, duration.seconds].join(":")
}