MCPcopy
hub / github.com/simstudioai/sim / formatGmtOffset

Function formatGmtOffset

apps/sim/lib/core/utils/timezone.ts:53–59  ·  view source on GitHub ↗

`GMT±HH:MM` for an offset expressed in minutes east of UTC (e.g. `GMT-08:00`).

(offsetMinutes: number)

Source from the content-addressed store, hash-verified

51
52/** `GMT±HH:MM` for an offset expressed in minutes east of UTC (e.g. `GMT-08:00`). */
53function formatGmtOffset(offsetMinutes: number): string {
54 const sign = offsetMinutes >= 0 ? '+' : '-'
55 const absMinutes = Math.abs(offsetMinutes)
56 const hours = String(Math.floor(absMinutes / 60)).padStart(2, '0')
57 const minutes = String(absMinutes % 60).padStart(2, '0')
58 return `GMT${sign}${hours}:${minutes}`
59}
60
61/**
62 * Timezone options for a picker. Each zone reads as `City (GMT±HH:MM)` — city

Callers 1

getTimezoneOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected