# utc

Industry: Core

## [calculate](/gmt/reference/utc/calculate/)

- [`addUtc`](/gmt/reference/utc/calculate/addUtc/): Add a temporal amount to a UTC datetime string and return a new UTC Instant string.
- [`diffUtc`](/gmt/reference/utc/calculate/diffUtc/): Return the difference between two UTC datetimes measured in the given date-time unit.
- [`diffUtcAsDuration`](/gmt/reference/utc/calculate/diffUtcAsDuration/): Return the difference between two UTC datetimes as an ISO 8601 duration string, bridging to the `duration` namespace (see `parseDuration`, `normalizeDuration`).
- [`endOfQuarterForUtc`](/gmt/reference/utc/calculate/endOfQuarterForUtc/): Return the end of the quarter for a given UTC Instant string.
- [`endOfUtc`](/gmt/reference/utc/calculate/endOfUtc/): Return the end of the specified date-time `unit` for a given UTC datetime string.
- [`isBetweenUtc`](/gmt/reference/utc/calculate/isBetweenUtc/): Return true when `value` is between `start` and `end` (inclusive by default).
- [`maxUtc`](/gmt/reference/utc/calculate/maxUtc/): Return the latest (maximum) of the given UTC datetime values.
- [`minUtc`](/gmt/reference/utc/calculate/minUtc/): Return the earliest (minimum) of the given UTC datetime values.
- [`roundUtc`](/gmt/reference/utc/calculate/roundUtc/): Round a UTC datetime string to the specified unit.
- [`secondsUntilHttpDate`](/gmt/reference/utc/calculate/secondsUntilHttpDate/): Return the whole seconds from now until an HTTP header date, such as `Expires`.
- [`secondsUntilRetryAfter`](/gmt/reference/utc/calculate/secondsUntilRetryAfter/): Return the whole seconds to wait from a `Retry-After` header value.
- [`setUtc`](/gmt/reference/utc/calculate/setUtc/): Return a UTC Instant string with the given `fields` set on `value`.
- [`sortUtc`](/gmt/reference/utc/calculate/sortUtc/): Sort an array of UTC datetime values in ascending or descending order.
- [`startOfQuarterForUtc`](/gmt/reference/utc/calculate/startOfQuarterForUtc/): Return the start of the quarter for a given UTC datetime string.
- [`startOfUtc`](/gmt/reference/utc/calculate/startOfUtc/): Return the start of the specified date-time `unit` for a given UTC datetime string.
- [`subtractUtc`](/gmt/reference/utc/calculate/subtractUtc/): Subtract a temporal amount from a UTC datetime string and return a new UTC Instant string.

## [chop](/gmt/reference/utc/chop/)

- [`chopUtc`](/gmt/reference/utc/chop/chopUtc/): Return the UTC datetime string with a trailing Z removed if present.

## [compare](/gmt/reference/utc/compare/)

- [`areUtcEqual`](/gmt/reference/utc/compare/areUtcEqual/): Return whether `value1` and `value2` represent the same instant.
- [`areUtcEqualBy`](/gmt/reference/utc/compare/areUtcEqualBy/): Compare two UTC ISO datetime strings for equality at a given unit.
- [`isAfterUtc`](/gmt/reference/utc/compare/isAfterUtc/): Return whether `value1` represents an instant strictly after `value2`.
- [`isBeforeUtc`](/gmt/reference/utc/compare/isBeforeUtc/): Return whether `value1` represents an instant strictly before `value2`.

## [convert](/gmt/reference/utc/convert/)

- [`convertUtcToPlainDate`](/gmt/reference/utc/convert/convertUtcToPlainDate/): Convert a UTC datetime string to a plain date string in the format "YYYY-MM-DD".
- [`convertUtcToPlainDateTime`](/gmt/reference/utc/convert/convertUtcToPlainDateTime/): Convert a UTC datetime string to a plain datetime string in the format "YYYY-MM-DDTHH:mm:ss".
- [`convertUtcToPlainTime`](/gmt/reference/utc/convert/convertUtcToPlainTime/): Convert a UTC datetime string to a plain time string in the format "HH:mm:ss".
- [`convertUtcToUnix`](/gmt/reference/utc/convert/convertUtcToUnix/): Convert a UTC Instant string to a unix epoch value in milliseconds or seconds.
- [`convertUtcToZoned`](/gmt/reference/utc/convert/convertUtcToZoned/): Convert a UTC Instant string to a zoned ISO 8601 datetime string.

## [format](/gmt/reference/utc/format/)

- [`formatCalendarUtc`](/gmt/reference/utc/format/formatCalendarUtc/): Format a UTC ISO string as a relative day label plus time-of-day, e.g. "tomorrow at 14:30" — the UTC counterpart of `formatCalendar`.
- [`formatHttpDate`](/gmt/reference/utc/format/formatHttpDate/): Format a UTC ISO 8601 datetime string as an HTTP header date — the RFC 9110 IMF-fixdate that headers like `Last-Modified`/`Date`/`Expires` require.
- [`formatHttpDateFromNow`](/gmt/reference/utc/format/formatHttpDateFromNow/): Return the RFC 9110 HTTP date (IMF-fixdate) after now, counted from the current time.
- [`formatRelativeUtc`](/gmt/reference/utc/format/formatRelativeUtc/): Format the relative time between a UTC ISO string and a reference instant.
- [`formatUtc`](/gmt/reference/utc/format/formatUtc/): Format a UTC ISO string as a localized date/time string.

## [get](/gmt/reference/utc/get/)

- [`getUtcAgo`](/gmt/reference/utc/get/getUtcAgo/): Return the UTC instant before now, as an ISO Instant string, counted from the current time.
- [`getUtcDay`](/gmt/reference/utc/get/getUtcDay/): Return the current day from UTC as a zero-padded string.
- [`getUtcHour`](/gmt/reference/utc/get/getUtcHour/): Return the current hour from UTC as a zero-padded string.
- [`getUtcIn`](/gmt/reference/utc/get/getUtcIn/): Return the UTC instant after now, as an ISO Instant string, counted from the current time.
- [`getUtcMicrosecond`](/gmt/reference/utc/get/getUtcMicrosecond/): Return the current microsecond from UTC as a zero-padded string.
- [`getUtcMillisecond`](/gmt/reference/utc/get/getUtcMillisecond/): Return the current millisecond from UTC as a zero-padded string.
- [`getUtcMinute`](/gmt/reference/utc/get/getUtcMinute/): Return the current minute from UTC as a zero-padded string.
- [`getUtcMonth`](/gmt/reference/utc/get/getUtcMonth/): Return the current month from UTC as a zero-padded string.
- [`getUtcNanosecond`](/gmt/reference/utc/get/getUtcNanosecond/): Return the current nanosecond from UTC as a zero-padded string.
- [`getUtcNow`](/gmt/reference/utc/get/getUtcNow/): Return the current UTC instant as an ISO Instant string.
- [`getUtcNowUnit`](/gmt/reference/utc/get/getUtcNowUnit/): Return the requested unit value from the current UTC instant.
- [`getUtcSecond`](/gmt/reference/utc/get/getUtcSecond/): Return the current second from UTC as a zero-padded string.
- [`getUtcYear`](/gmt/reference/utc/get/getUtcYear/): Return the current year from UTC as a zero-padded string.

## [interval](/gmt/reference/utc/interval/)

- [`intervalAbutsUtc`](/gmt/reference/utc/interval/intervalAbutsUtc/): Return true when two half-open UTC intervals `[aStart, aEnd)` and `[bStart, bEnd)` are exactly adjacent — one ends where the other starts, so they share nothing and leave no gap.
- [`intervalContainsUtc`](/gmt/reference/utc/interval/intervalContainsUtc/): Return true when `pointOrStart` lies in the half-open interval `[intervalStart, intervalEnd)` (3-arg), or when the inner interval `[innerStart, innerEnd)` lies within it (4-arg).
- [`intervalCountUtc`](/gmt/reference/utc/interval/intervalCountUtc/): Count how many `unit` boundaries a UTC interval crosses.
- [`intervalDifferenceUtc`](/gmt/reference/utc/interval/intervalDifferenceUtc/): Return the portion(s) of interval A not covered by interval B.
- [`intervalDivideEquallyUtc`](/gmt/reference/utc/interval/intervalDivideEquallyUtc/): Split a UTC interval into `n` equal-length sub-intervals.
- [`intervalEngulfsUtc`](/gmt/reference/utc/interval/intervalEngulfsUtc/): Return true when the half-open interval B `[bStart, bEnd)` lies within the half-open interval A `[aStart, aEnd)` — every instant of B is also in A.
- [`intervalFromDurationUtc`](/gmt/reference/utc/interval/intervalFromDurationUtc/): Construct a UTC interval from a single point plus an ISO 8601 duration, anchored at either end.
- [`intervalIntersectionUtc`](/gmt/reference/utc/interval/intervalIntersectionUtc/): Return the overlapping span of two UTC intervals, or null when they do not overlap.
- [`intervalLengthUtc`](/gmt/reference/utc/interval/intervalLengthUtc/): Return the exact length of a UTC interval in `unit`, as a real (possibly fractional) number.
- [`intervalOverlappingDaysUtc`](/gmt/reference/utc/interval/intervalOverlappingDaysUtc/): Return how many distinct UTC calendar dates two UTC intervals share.
- [`intervalsOverlapUtc`](/gmt/reference/utc/interval/intervalsOverlapUtc/): Return true when the half-open UTC intervals `[aStart, aEnd)` and `[bStart, bEnd)` share at least one instant.
- [`intervalSplitAtUtc`](/gmt/reference/utc/interval/intervalSplitAtUtc/): Split a UTC interval at arbitrary `points`, producing consecutive sub-intervals.
- [`intervalUnionUtc`](/gmt/reference/utc/interval/intervalUnionUtc/): Return the combined span of two UTC intervals, or null when they are disjoint.
- [`intervalXorAllUtc`](/gmt/reference/utc/interval/intervalXorAllUtc/): Return the symmetric difference across a list of UTC intervals — the set of instants covered by an odd number of the input intervals.
- [`intervalXorUtc`](/gmt/reference/utc/interval/intervalXorUtc/): Return the symmetric difference of two UTC intervals — time covered by exactly one interval.
- [`isValidUtcInterval`](/gmt/reference/utc/interval/isValidUtcInterval/): Return true if `start` and `end` form a valid UTC interval — both parseable as ISO UTC datetime strings and the instant at `start` is &lt;= the instant at `end`.
- [`mergeIntervalsUtc`](/gmt/reference/utc/interval/mergeIntervalsUtc/): Collapse a list of UTC intervals into the minimum set of non-overlapping intervals.
- [`splitIntervalByUnitUtc`](/gmt/reference/utc/interval/splitIntervalByUnitUtc/): Split a UTC interval into sub-intervals of `amount × unit`.

## [parse](/gmt/reference/utc/parse/)

- [`parseDateFromUtc`](/gmt/reference/utc/parse/parseDateFromUtc/): Extract the date portion from a UTC datetime string.
- [`parseDayFromUtc`](/gmt/reference/utc/parse/parseDayFromUtc/): Return the day of month (1-31) from a UTC datetime string.
- [`parseDayOfWeekFromUtc`](/gmt/reference/utc/parse/parseDayOfWeekFromUtc/): Return the day of week (1-7) from a UTC datetime string.
- [`parseHourFromUtc`](/gmt/reference/utc/parse/parseHourFromUtc/): Return the hour (0-23) from a UTC datetime string.
- [`parseHttpDate`](/gmt/reference/utc/parse/parseHttpDate/): Parse an HTTP header date — the RFC 9110 HTTP-date that headers like `Last-Modified`/`Date`/`Expires` carry — into a UTC ISO 8601 datetime string.
- [`parseMicrosecondFromUtc`](/gmt/reference/utc/parse/parseMicrosecondFromUtc/): Return the microsecond (0-999) from a UTC datetime string.
- [`parseMillisecondFromUtc`](/gmt/reference/utc/parse/parseMillisecondFromUtc/): Return the millisecond (0-999) from a UTC datetime string.
- [`parseMinuteFromUtc`](/gmt/reference/utc/parse/parseMinuteFromUtc/): Return the minute (0-59) from a UTC datetime string.
- [`parseMonthFromUtc`](/gmt/reference/utc/parse/parseMonthFromUtc/): Return the month (1-12) from a UTC datetime string.
- [`parseNanosecondFromUtc`](/gmt/reference/utc/parse/parseNanosecondFromUtc/): Return the nanosecond (0-999) from a UTC datetime string.
- [`parseSecondFromUtc`](/gmt/reference/utc/parse/parseSecondFromUtc/): Return the second (0-59) from a UTC datetime string.
- [`parseTimeFromUtc`](/gmt/reference/utc/parse/parseTimeFromUtc/): Extract the time portion from a UTC datetime string.
- [`parseUnitFromUtc`](/gmt/reference/utc/parse/parseUnitFromUtc/): Extract a unit from a UTC datetime string.
- [`parseWeekFromUtc`](/gmt/reference/utc/parse/parseWeekFromUtc/): Return the week number from a UTC datetime string.
- [`parseYearFromUtc`](/gmt/reference/utc/parse/parseYearFromUtc/): Return the year from a UTC datetime string.

## [validate](/gmt/reference/utc/validate/)

- [`isValidHttpDate`](/gmt/reference/utc/validate/isValidHttpDate/): Return true when `value` is a real HTTP header date: the RFC 9110 §5.6.7 HTTP-date that headers like `Last-Modified`, `Date` and `Expires` carry, such as `Fri, 15 Mar 2024 14:30:00 GMT`.
- [`isValidUtc`](/gmt/reference/utc/validate/isValidUtc/): Return true when the provided string is a valid ISO 8601 UTC datetime.
- [`isValidUtcRange`](/gmt/reference/utc/validate/isValidUtcRange/): Return true if `value1` and `value2` form a valid UTC range — both parseable as ISO UTC datetime strings and the instant at `value1` is before the instant at `value2`.
- [`isValidUtcTimestamp`](/gmt/reference/utc/validate/isValidUtcTimestamp/): Return true when `value` is a real UTC instant written as `YYYY-MM-DDTHH:MM:SS[.f]Z` and nothing else: a narrower check than `isValidUtc`.
