formatCalendarUtc
Signature
Section titled “Signature”formatCalendarUtc(value: string, locale?: string, options?: FormatCalendarUtcOptions): stringimport { formatCalendarUtc } from "@northguild/gmt/utc/format";Format a UTC ISO string as a relative day label plus time-of-day, e.g.
- “Tomorrow at 2:30 PM” — the UTC counterpart of
formatCalendar. See that function’s JSDoc for the day-label/threshold/connector design; this variant compares calendar days and renders the clock time intimeZone(default"UTC").
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
UTC ISO string to format |
locale |
string |
optional: BCP 47 locale tag |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
reference? |
string |
— |
timeZone? |
string |
— |
timeStyle? |
"short" | "medium" | "full" |
— |
Returns
Section titled “Returns”the formatted calendar string, or “” on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”formatCalendarUtc("2026-03-16T18:30:00Z", "en-US", { timeZone: "America/New_York", reference: "2026-03-15T13:00:00Z" }) // "tomorrow at 2:30 PM"formatCalendarUtc(value, "fr-FR", { timeZone: "Europe/Paris" }) // "demain à 14:30"formatCalendarUtc("not-a-date") // ""