MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatAbsoluteTime

Function formatAbsoluteTime

apps/vis/web/src/util/time.ts:20–25  ·  view source on GitHub ↗
(epochMs: number)

Source from the content-addressed store, hash-verified

18
19/** Format an epoch-ms timestamp as ISO-ish local time (YYYY-MM-DD HH:MM:SS). */
20export 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). */
28export function formatWallClock(epochMs: number): string {

Callers 5

ManifestCardFunction · 0.90
TsValueFunction · 0.90
TaskCardFunction · 0.90
CronCardFunction · 0.90
SessionDetailPageFunction · 0.90

Calls 1

padFunction · 0.70

Tested by

no test coverage detected