offsetAt
Module Export
instant | date |> (zone: Timezone) => minutesThe UTC offset in force at a given instant, in the given timezone.
Remarks
The offset at that instant — not the zone’s current offset. A zone observing daylight saving has at least two offsets during a year, and its historical rules may differ from today’s, so an offset is only meaningful with respect to a point in time.
Returned as a minutes duration rather than a number, because not every offset is a
whole number of hours: India is UTC+05:30 and Nepal UTC+05:45.
Reaching for this to do your own calendar arithmetic is usually a mistake — applying a single offset across a range breaks at every transition. Prefer startOf and periods, which resolve each boundary individually.
Examples
import 'calendar'
from 2026-07-15T12:00:00Z offsetAt 'Europe/Stockholm'
// Returns:// Summer time120 minutesimport 'calendar'
from 2026-01-15T12:00:00Z offsetAt 'Europe/Stockholm'
// Returns:// Standard time60 minutesHistorical rules are honoured — Sweden observed no summer time in 1970:
import 'calendar'
from 1970-07-15T12:00:00Z offsetAt 'Europe/Stockholm'
// Returns:60 minutesOffsets need not be whole hours:
import 'calendar'
from 2026-07-15T12:00:00Z offsetAt 'Asia/Kolkata'
// Returns:330 minutes