turn milliseconds to human readable string typescript code example
Example: turn milliseconds to human readable string typescript
public static msToTime (ms: number): string {
const date = new Date(ms)
const h = date.getHours()
const m = date.getMinutes()
const s = date.getSeconds()
return `${h < 10 ? `0${h}` : h}:${m < 10 ? `0${m}` : m}:${s < 10 ? `0${s}` : s}`
}