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

Function formatTimeWithSeconds

packages/utils/src/formatting.ts:127–135  ·  view source on GitHub ↗
(date: Date, includeTimezone = true)

Source from the content-addressed store, hash-verified

125 * @returns A formatted time string in the format "h:mm:ss AM/PM TZ"
126 */
127export function formatTimeWithSeconds(date: Date, includeTimezone = true): string {
128 return date.toLocaleTimeString('en-US', {
129 hour: 'numeric',
130 minute: '2-digit',
131 second: '2-digit',
132 hour12: true,
133 timeZoneName: includeTimezone ? 'short' : undefined,
134 })
135}
136
137/**
138 * Format an ISO timestamp into a compact format for UI display

Callers 1

formatting.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected