(epochMs: number)
| 18 | |
| 19 | /** Format an epoch-ms timestamp as ISO-ish local time (YYYY-MM-DD HH:MM:SS). */ |
| 20 | export function formatAbsoluteTime(epochMs: number): string { |
| 21 | if (!epochMs || !Number.isFinite(epochMs)) return '—'; |
| 22 | const d = new Date(epochMs); |
| 23 | const pad = (n: number) => String(n).padStart(2, '0'); |
| 24 | return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())}`; |
| 25 | } |
| 26 | |
| 27 | /** Format an epoch-ms timestamp as HH:MM:SS (wall clock). */ |
| 28 | export function formatWallClock(epochMs: number): string { |
no test coverage detected