Function
formatTimeWithSeconds
(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 | */ |
| 127 | export 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 |
Tested by
no test coverage detected