MCPcopy Index your code
hub / github.com/simstudioai/sim / formatCompactTimestamp

Function formatCompactTimestamp

packages/utils/src/formatting.ts:142–153  ·  view source on GitHub ↗
(iso: string)

Source from the content-addressed store, hash-verified

140 * @returns A formatted string in "MM-DD HH:mm" format
141 */
142export function formatCompactTimestamp(iso: string): string {
143 try {
144 const d = new Date(iso)
145 const mm = String(d.getMonth() + 1).padStart(2, '0')
146 const dd = String(d.getDate()).padStart(2, '0')
147 const hh = String(d.getHours()).padStart(2, '0')
148 const min = String(d.getMinutes()).padStart(2, '0')
149 return `${mm}-${dd} ${hh}:${min}`
150 } catch {
151 return iso
152 }
153}
154
155/**
156 * Format a duration to a human-readable format

Callers 1

formatting.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected