# @northguild/gmt/utc > UTC date-times and HTTP dates as ISO 8601 strings: arithmetic, comparison, formatting, parsing and conversion. Back to the [root llms.txt](https://northguild.dev/gmt/llms.txt). ## calculate - [addUtc](https://northguild.dev/gmt/reference/utc/calculate/addUtc.md): Add a temporal amount to a UTC datetime string and return a new UTC Instant string. - [diffUtc](https://northguild.dev/gmt/reference/utc/calculate/diffUtc.md): Return the difference between two UTC datetimes measured in the given date-time unit. - [diffUtcAsDuration](https://northguild.dev/gmt/reference/utc/calculate/diffUtcAsDuration.md): Return the difference between two UTC datetimes as an ISO 8601 duration string, bridging to the `duration` namespace (see `parseDuration`, `normalizeDuration`). - [endOfQuarterForUtc](https://northguild.dev/gmt/reference/utc/calculate/endOfQuarterForUtc.md): Return the end of the quarter for a given UTC Instant string. - [endOfUtc](https://northguild.dev/gmt/reference/utc/calculate/endOfUtc.md): Return the end of the specified date-time `unit` for a given UTC datetime string. - [isBetweenUtc](https://northguild.dev/gmt/reference/utc/calculate/isBetweenUtc.md): Return true when `value` is between `start` and `end` (inclusive by default). - [maxUtc](https://northguild.dev/gmt/reference/utc/calculate/maxUtc.md): Return the latest (maximum) of the given UTC datetime values. - [minUtc](https://northguild.dev/gmt/reference/utc/calculate/minUtc.md): Return the earliest (minimum) of the given UTC datetime values. - [roundUtc](https://northguild.dev/gmt/reference/utc/calculate/roundUtc.md): Round a UTC datetime string to the specified unit. - [secondsUntilHttpDate](https://northguild.dev/gmt/reference/utc/calculate/secondsUntilHttpDate.md): Return the whole seconds from now until an HTTP header date, such as `Expires`. - [secondsUntilRetryAfter](https://northguild.dev/gmt/reference/utc/calculate/secondsUntilRetryAfter.md): Return the whole seconds to wait from a `Retry-After` header value. - [setUtc](https://northguild.dev/gmt/reference/utc/calculate/setUtc.md): Return a UTC Instant string with the given `fields` set on `value`. - [sortUtc](https://northguild.dev/gmt/reference/utc/calculate/sortUtc.md): Sort an array of UTC datetime values in ascending or descending order. - [startOfQuarterForUtc](https://northguild.dev/gmt/reference/utc/calculate/startOfQuarterForUtc.md): Return the start of the quarter for a given UTC datetime string. - [startOfUtc](https://northguild.dev/gmt/reference/utc/calculate/startOfUtc.md): Return the start of the specified date-time `unit` for a given UTC datetime string. - [subtractUtc](https://northguild.dev/gmt/reference/utc/calculate/subtractUtc.md): Subtract a temporal amount from a UTC datetime string and return a new UTC Instant string. ## chop - [chopUtc](https://northguild.dev/gmt/reference/utc/chop/chopUtc.md): Return the UTC datetime string with a trailing Z removed if present. ## compare - [areUtcEqual](https://northguild.dev/gmt/reference/utc/compare/areUtcEqual.md): Return whether `value1` and `value2` represent the same instant. - [areUtcEqualBy](https://northguild.dev/gmt/reference/utc/compare/areUtcEqualBy.md): Compare two UTC ISO datetime strings for equality at a given unit. - [isAfterUtc](https://northguild.dev/gmt/reference/utc/compare/isAfterUtc.md): Return whether `value1` represents an instant strictly after `value2`. - [isBeforeUtc](https://northguild.dev/gmt/reference/utc/compare/isBeforeUtc.md): Return whether `value1` represents an instant strictly before `value2`. ## convert - [convertUtcToPlainDate](https://northguild.dev/gmt/reference/utc/convert/convertUtcToPlainDate.md): Convert a UTC datetime string to a plain date string in the format "YYYY-MM-DD". - [convertUtcToPlainDateTime](https://northguild.dev/gmt/reference/utc/convert/convertUtcToPlainDateTime.md): Convert a UTC datetime string to a plain datetime string in the format "YYYY-MM-DDTHH:mm:ss". - [convertUtcToPlainTime](https://northguild.dev/gmt/reference/utc/convert/convertUtcToPlainTime.md): Convert a UTC datetime string to a plain time string in the format "HH:mm:ss". - [convertUtcToUnix](https://northguild.dev/gmt/reference/utc/convert/convertUtcToUnix.md): Convert a UTC Instant string to a unix epoch value in milliseconds or seconds. - [convertUtcToZoned](https://northguild.dev/gmt/reference/utc/convert/convertUtcToZoned.md): Convert a UTC Instant string to a zoned ISO 8601 datetime string. ## format - [formatCalendarUtc](https://northguild.dev/gmt/reference/utc/format/formatCalendarUtc.md): 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`. See that function's JSDoc for the day-label/threshold/connector design; this variant compares calendar days and renders the clock time in `timeZone`. - [formatHttpDate](https://northguild.dev/gmt/reference/utc/format/formatHttpDate.md): 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](https://northguild.dev/gmt/reference/utc/format/formatHttpDateFromNow.md): Return the RFC 9110 HTTP date (IMF-fixdate) after now, counted from the current time. It is the value for an `Expires` attribute or header. - [formatRelativeUtc](https://northguild.dev/gmt/reference/utc/format/formatRelativeUtc.md): Format the relative time between a UTC ISO string and a reference instant. - [formatUtc](https://northguild.dev/gmt/reference/utc/format/formatUtc.md): Format a UTC ISO string as a localized date/time string. ## get - [getUtcAgo](https://northguild.dev/gmt/reference/utc/get/getUtcAgo.md): Return the UTC instant before now, as an ISO Instant string, counted from the current time. - [getUtcDay](https://northguild.dev/gmt/reference/utc/get/getUtcDay.md): Return the current day from UTC as a zero-padded string. - [getUtcHour](https://northguild.dev/gmt/reference/utc/get/getUtcHour.md): Return the current hour from UTC as a zero-padded string. - [getUtcIn](https://northguild.dev/gmt/reference/utc/get/getUtcIn.md): Return the UTC instant after now, as an ISO Instant string, counted from the current time. - [getUtcMicrosecond](https://northguild.dev/gmt/reference/utc/get/getUtcMicrosecond.md): Return the current microsecond from UTC as a zero-padded string. - [getUtcMillisecond](https://northguild.dev/gmt/reference/utc/get/getUtcMillisecond.md): Return the current millisecond from UTC as a zero-padded string. - [getUtcMinute](https://northguild.dev/gmt/reference/utc/get/getUtcMinute.md): Return the current minute from UTC as a zero-padded string. - [getUtcMonth](https://northguild.dev/gmt/reference/utc/get/getUtcMonth.md): Return the current month from UTC as a zero-padded string. - [getUtcNanosecond](https://northguild.dev/gmt/reference/utc/get/getUtcNanosecond.md): Return the current nanosecond from UTC as a zero-padded string. - [getUtcNow](https://northguild.dev/gmt/reference/utc/get/getUtcNow.md): Return the current UTC instant as an ISO Instant string. - [getUtcNowUnit](https://northguild.dev/gmt/reference/utc/get/getUtcNowUnit.md): Return the requested unit value from the current UTC instant. - [getUtcSecond](https://northguild.dev/gmt/reference/utc/get/getUtcSecond.md): Return the current second from UTC as a zero-padded string. - [getUtcYear](https://northguild.dev/gmt/reference/utc/get/getUtcYear.md): Return the current year from UTC as a zero-padded string. ## interval - [intervalAbutsUtc](https://northguild.dev/gmt/reference/utc/interval/intervalAbutsUtc.md): 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](https://northguild.dev/gmt/reference/utc/interval/intervalContainsUtc.md): 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](https://northguild.dev/gmt/reference/utc/interval/intervalCountUtc.md): Count how many `unit` boundaries a UTC interval crosses. - [intervalDifferenceUtc](https://northguild.dev/gmt/reference/utc/interval/intervalDifferenceUtc.md): Return the portion(s) of interval A not covered by interval B. - [intervalDivideEquallyUtc](https://northguild.dev/gmt/reference/utc/interval/intervalDivideEquallyUtc.md): Split a UTC interval into `n` equal-length sub-intervals. - [intervalEngulfsUtc](https://northguild.dev/gmt/reference/utc/interval/intervalEngulfsUtc.md): 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](https://northguild.dev/gmt/reference/utc/interval/intervalFromDurationUtc.md): Construct a UTC interval from a single point plus an ISO 8601 duration, anchored at either end. - [intervalIntersectionUtc](https://northguild.dev/gmt/reference/utc/interval/intervalIntersectionUtc.md): Return the overlapping span of two UTC intervals, or null when they do not overlap. - [intervalLengthUtc](https://northguild.dev/gmt/reference/utc/interval/intervalLengthUtc.md): Return the exact length of a UTC interval in `unit`, as a real (possibly fractional) number. - [intervalOverlappingDaysUtc](https://northguild.dev/gmt/reference/utc/interval/intervalOverlappingDaysUtc.md): Return how many distinct UTC calendar dates two UTC intervals share. - [intervalsOverlapUtc](https://northguild.dev/gmt/reference/utc/interval/intervalsOverlapUtc.md): Return true when the half-open UTC intervals `[aStart, aEnd)` and `[bStart, bEnd)` share at least one instant. - [intervalSplitAtUtc](https://northguild.dev/gmt/reference/utc/interval/intervalSplitAtUtc.md): Split a UTC interval at arbitrary `points`, producing consecutive sub-intervals. - [intervalUnionUtc](https://northguild.dev/gmt/reference/utc/interval/intervalUnionUtc.md): Return the combined span of two UTC intervals, or null when they are disjoint. - [intervalXorAllUtc](https://northguild.dev/gmt/reference/utc/interval/intervalXorAllUtc.md): Return the symmetric difference across a list of UTC intervals — the set of instants covered by an odd number of the input intervals. - [intervalXorUtc](https://northguild.dev/gmt/reference/utc/interval/intervalXorUtc.md): Return the symmetric difference of two UTC intervals — time covered by exactly one interval. - [isValidUtcInterval](https://northguild.dev/gmt/reference/utc/interval/isValidUtcInterval.md): Return true if `start` and `end` form a valid UTC interval — both parseable as ISO UTC datetime strings and the instant at `start` is <= the instant at `end`. - [mergeIntervalsUtc](https://northguild.dev/gmt/reference/utc/interval/mergeIntervalsUtc.md): Collapse a list of UTC intervals into the minimum set of non-overlapping intervals. - [splitIntervalByUnitUtc](https://northguild.dev/gmt/reference/utc/interval/splitIntervalByUnitUtc.md): Split a UTC interval into sub-intervals of `amount × unit`. ## parse - [parseDateFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseDateFromUtc.md): Extract the date portion from a UTC datetime string. - [parseDayFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseDayFromUtc.md): Return the day of month (1-31) from a UTC datetime string. - [parseDayOfWeekFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseDayOfWeekFromUtc.md): Return the day of week (1-7) from a UTC datetime string. - [parseHourFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseHourFromUtc.md): Return the hour (0-23) from a UTC datetime string. - [parseHttpDate](https://northguild.dev/gmt/reference/utc/parse/parseHttpDate.md): 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](https://northguild.dev/gmt/reference/utc/parse/parseMicrosecondFromUtc.md): Return the microsecond (0-999) from a UTC datetime string. - [parseMillisecondFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseMillisecondFromUtc.md): Return the millisecond (0-999) from a UTC datetime string. - [parseMinuteFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseMinuteFromUtc.md): Return the minute (0-59) from a UTC datetime string. - [parseMonthFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseMonthFromUtc.md): Return the month (1-12) from a UTC datetime string. - [parseNanosecondFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseNanosecondFromUtc.md): Return the nanosecond (0-999) from a UTC datetime string. - [parseSecondFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseSecondFromUtc.md): Return the second (0-59) from a UTC datetime string. - [parseTimeFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseTimeFromUtc.md): Extract the time portion from a UTC datetime string. - [parseUnitFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseUnitFromUtc.md): Extract a unit from a UTC datetime string. - [parseWeekFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseWeekFromUtc.md): Return the week number from a UTC datetime string. - [parseYearFromUtc](https://northguild.dev/gmt/reference/utc/parse/parseYearFromUtc.md): Return the year from a UTC datetime string. ## validate - [isValidHttpDate](https://northguild.dev/gmt/reference/utc/validate/isValidHttpDate.md): 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](https://northguild.dev/gmt/reference/utc/validate/isValidUtc.md): Return true when the provided string is a valid ISO 8601 UTC datetime. - [isValidUtcRange](https://northguild.dev/gmt/reference/utc/validate/isValidUtcRange.md): 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](https://northguild.dev/gmt/reference/utc/validate/isValidUtcTimestamp.md): 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`.