# unix

Industry: Core

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

- [`addUnix`](/gmt/reference/unix/calculate/addUnix/): Add a temporal amount to a Unix epoch value and return the resulting epoch.
- [`diffUnix`](/gmt/reference/unix/calculate/diffUnix/): Return the difference between two Unix timestamps measured in the given unit.
- [`diffUnixAsDuration`](/gmt/reference/unix/calculate/diffUnixAsDuration/): Return the difference between two Unix timestamps as an ISO 8601 duration string, bridging to the `duration` namespace (see `parseDuration`, `normalizeDuration`).
- [`endOfQuarterForUnix`](/gmt/reference/unix/calculate/endOfQuarterForUnix/): Return the end of the quarter for a Unix timestamp.
- [`endOfUnix`](/gmt/reference/unix/calculate/endOfUnix/): Return the end of the specified unit for a Unix timestamp.
- [`isBetweenUnix`](/gmt/reference/unix/calculate/isBetweenUnix/): Return true when the Unix timestamp is between start and end (inclusive by default).
- [`maxUnix`](/gmt/reference/unix/calculate/maxUnix/): Return the latest (maximum) of the given Unix timestamp values.
- [`minUnix`](/gmt/reference/unix/calculate/minUnix/): Return the earliest (minimum) of the given Unix timestamp values.
- [`roundUnix`](/gmt/reference/unix/calculate/roundUnix/): Round a Unix timestamp to the specified unit.
- [`secondsUntilUnix`](/gmt/reference/unix/calculate/secondsUntilUnix/): Return the whole seconds from now until a stored Unix epoch, such as a JWT `exp`.
- [`setUnix`](/gmt/reference/unix/calculate/setUnix/): Return a Unix epoch value with the given `fields` set on `value`, interpreted in `timeZone`.
- [`sortUnix`](/gmt/reference/unix/calculate/sortUnix/): Sort an array of Unix timestamp values in ascending or descending order.
- [`startOfQuarterForUnix`](/gmt/reference/unix/calculate/startOfQuarterForUnix/): Return the start of the quarter for a Unix timestamp.
- [`startOfUnix`](/gmt/reference/unix/calculate/startOfUnix/): Return the start of the specified unit for a Unix timestamp.
- [`subtractUnix`](/gmt/reference/unix/calculate/subtractUnix/): Subtract a temporal amount from a Unix epoch value and return the resulting epoch.

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

- [`areUnixEqual`](/gmt/reference/unix/compare/areUnixEqual/): Return whether `value1` and `value2` represent the same instant.
- [`areUnixEqualBy`](/gmt/reference/unix/compare/areUnixEqualBy/): Compare two Unix epoch values for equality at a given unit.
- [`isAfterUnix`](/gmt/reference/unix/compare/isAfterUnix/): Return whether `value1` represents an instant strictly after `value2`.
- [`isBeforeUnix`](/gmt/reference/unix/compare/isBeforeUnix/): Return whether `value1` represents an instant strictly before `value2`.

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

- [`convertUnixToPlainDate`](/gmt/reference/unix/convert/convertUnixToPlainDate/): Convert a Unix timestamp to a plain date string in the format "YYYY-MM-DD".
- [`convertUnixToPlainDateTime`](/gmt/reference/unix/convert/convertUnixToPlainDateTime/): Convert a Unix timestamp to a plain datetime string in the format "YYYY-MM-DDTHH:mm:ss".
- [`convertUnixToPlainTime`](/gmt/reference/unix/convert/convertUnixToPlainTime/): Convert a Unix timestamp to a plain time string in the format "HH:mm:ss".
- [`convertUnixToUtc`](/gmt/reference/unix/convert/convertUnixToUtc/): Convert a unix epoch value to a UTC Instant ISO string.
- [`convertUnixToZoned`](/gmt/reference/unix/convert/convertUnixToZoned/): Convert a unix epoch value to a zoned ISO 8601 datetime string.

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

- [`formatCalendarUnix`](/gmt/reference/unix/format/formatCalendarUnix/): Format a unix epoch value as a relative day label plus time-of-day, e.g. "tomorrow at 14:30" — the unix counterpart of `formatCalendar`.
- [`formatRelativeUnix`](/gmt/reference/unix/format/formatRelativeUnix/): Format the relative time between a unix epoch value and a reference instant.
- [`formatUnix`](/gmt/reference/unix/format/formatUnix/): Format a unix epoch value (string or number) as a localized date/time string.

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

- [`getUnixAgo`](/gmt/reference/unix/get/getUnixAgo/): Return the Unix epoch before now, counted from the current time in UTC.
- [`getUnixDay`](/gmt/reference/unix/get/getUnixDay/): Return the current day from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixHour`](/gmt/reference/unix/get/getUnixHour/): Return the current hour from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixIn`](/gmt/reference/unix/get/getUnixIn/): Return the Unix epoch after now, counted from the current time in UTC.
- [`getUnixMicrosecond`](/gmt/reference/unix/get/getUnixMicrosecond/): Return the current microsecond from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixMillisecond`](/gmt/reference/unix/get/getUnixMillisecond/): Return the current millisecond from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixMinute`](/gmt/reference/unix/get/getUnixMinute/): Return the current minute from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixMonth`](/gmt/reference/unix/get/getUnixMonth/): Return the current month from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixNanosecond`](/gmt/reference/unix/get/getUnixNanosecond/): Return the current nanosecond from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixNow`](/gmt/reference/unix/get/getUnixNow/): Return the current Unix timestamp in either seconds or milliseconds.
- [`getUnixNowUnit`](/gmt/reference/unix/get/getUnixNowUnit/): Return the requested unit value from the current Unix timestamp in UTC.
- [`getUnixSecond`](/gmt/reference/unix/get/getUnixSecond/): Return the current second from the Unix timestamp in UTC as a zero-padded string.
- [`getUnixYear`](/gmt/reference/unix/get/getUnixYear/): Return the current year from the Unix timestamp in UTC as a zero-padded string.

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

- [`intervalAbutsUnix`](/gmt/reference/unix/interval/intervalAbutsUnix/): Return true when two half-open Unix intervals `[start, end)` are exactly adjacent — one ends where the other starts, so they share no value and leave no gap (Allen's "meets", either order).
- [`intervalContainsUnix`](/gmt/reference/unix/interval/intervalContainsUnix/): Return true when `pointOrStart` falls within the half-open interval `[intervalStart, intervalEnd)` (3-arg), or when the inner interval `[innerStart, innerEnd)` lies within the outer interval `[intervalStart, intervalEnd)` (4-arg).
- [`intervalCountUnix`](/gmt/reference/unix/interval/intervalCountUnix/): Count how many `unit` boundaries a Unix epoch interval crosses.
- [`intervalDifferenceUnix`](/gmt/reference/unix/interval/intervalDifferenceUnix/): Return the portion(s) of the half-open interval A `[aStart, aEnd)` not covered by the half-open interval B `[bStart, bEnd)`.
- [`intervalDivideEquallyUnix`](/gmt/reference/unix/interval/intervalDivideEquallyUnix/): Split a Unix epoch interval into `n` equal-length sub-intervals.
- [`intervalEngulfsUnix`](/gmt/reference/unix/interval/intervalEngulfsUnix/): Return true when the half-open interval B `[bStart, bEnd)` lies within the half-open interval A `[aStart, aEnd)` — every instant of B falls within A.
- [`intervalFromDurationUnix`](/gmt/reference/unix/interval/intervalFromDurationUnix/): Construct a Unix epoch interval from a single point plus an ISO 8601 duration, anchored at either end.
- [`intervalIntersectionUnix`](/gmt/reference/unix/interval/intervalIntersectionUnix/): Return the overlapping span of two half-open Unix epoch intervals `[start, end)`, or null when they do not overlap.
- [`intervalLengthUnix`](/gmt/reference/unix/interval/intervalLengthUnix/): Return the exact length of a Unix epoch interval in `unit`, as a real (possibly fractional) number.
- [`intervalOverlappingDaysUnix`](/gmt/reference/unix/interval/intervalOverlappingDaysUnix/): Return how many distinct calendar dates two Unix epoch intervals share, in a given time zone.
- [`intervalsOverlapUnix`](/gmt/reference/unix/interval/intervalsOverlapUnix/): Return true when the half-open intervals `[aStart, aEnd)` and `[bStart, bEnd)` share at least one instant.
- [`intervalSplitAtUnix`](/gmt/reference/unix/interval/intervalSplitAtUnix/): Split a Unix epoch interval at arbitrary `points`, producing consecutive sub-intervals.
- [`intervalUnionUnix`](/gmt/reference/unix/interval/intervalUnionUnix/): Return the combined span of two half-open Unix epoch intervals `[start, end)`, or null when their union is not one non-empty span.
- [`intervalXorAllUnix`](/gmt/reference/unix/interval/intervalXorAllUnix/): Return the symmetric difference across a list of Unix epoch intervals — the set of epoch values covered by an odd number of the input intervals.
- [`intervalXorUnix`](/gmt/reference/unix/interval/intervalXorUnix/): Return the symmetric difference of two half-open Unix intervals `[start, end)` — the values covered by exactly one interval.
- [`isValidUnixInterval`](/gmt/reference/unix/interval/isValidUnixInterval/): Return true if `start` and `end` form a valid Unix interval — both safe-integer epochs and `start <= end`.
- [`mergeIntervalsUnix`](/gmt/reference/unix/interval/mergeIntervalsUnix/): Collapse a list of Unix epoch intervals into the minimum set of non-overlapping intervals.
- [`splitIntervalByUnitUnix`](/gmt/reference/unix/interval/splitIntervalByUnitUnix/): Split a Unix epoch interval into sub-intervals of `amount × unit`.

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

- [`parseDateFromUnix`](/gmt/reference/unix/parse/parseDateFromUnix/): Extract the date portion from a unix epoch value.
- [`parseDayFromUnix`](/gmt/reference/unix/parse/parseDayFromUnix/): Return the day of month (1-31) from a unix epoch value.
- [`parseDayOfWeekFromUnix`](/gmt/reference/unix/parse/parseDayOfWeekFromUnix/): Return the day of week (1-7) from a unix epoch value.
- [`parseHourFromUnix`](/gmt/reference/unix/parse/parseHourFromUnix/): Return the hour (0-23) from a unix epoch value.
- [`parseMicrosecondFromUnix`](/gmt/reference/unix/parse/parseMicrosecondFromUnix/): Return the microsecond (0-999) from a unix epoch value.
- [`parseMillisecondFromUnix`](/gmt/reference/unix/parse/parseMillisecondFromUnix/): Return the millisecond (0-999) from a unix epoch value.
- [`parseMinuteFromUnix`](/gmt/reference/unix/parse/parseMinuteFromUnix/): Return the minute (0-59) from a unix epoch value.
- [`parseMonthFromUnix`](/gmt/reference/unix/parse/parseMonthFromUnix/): Return the month (1-12) from a unix epoch value.
- [`parseNanosecondFromUnix`](/gmt/reference/unix/parse/parseNanosecondFromUnix/): Return the nanosecond (0-999) from a unix epoch value.
- [`parseSecondFromUnix`](/gmt/reference/unix/parse/parseSecondFromUnix/): Return the second (0-59) from a unix epoch value.
- [`parseTimeFromUnix`](/gmt/reference/unix/parse/parseTimeFromUnix/): Extract the time portion from a unix epoch value.
- [`parseUnitFromUnix`](/gmt/reference/unix/parse/parseUnitFromUnix/): Extract a unit from a unix epoch value.
- [`parseWeekFromUnix`](/gmt/reference/unix/parse/parseWeekFromUnix/): Return the week number from a unix epoch value.
- [`parseYearFromUnix`](/gmt/reference/unix/parse/parseYearFromUnix/): Return the year from a unix epoch value.

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

- [`isValidUnixMilliseconds`](/gmt/reference/unix/validate/isValidUnixMilliseconds/): Return true when `timestamp` is a Unix milliseconds value every `unix/` function accepts.
- [`isValidUnixRange`](/gmt/reference/unix/validate/isValidUnixRange/): Return true if `value1` and `value2` form a valid Unix range — both safe-integer epochs and `value1 < value2` (or `<=` with `allowEqual`).
- [`isValidUnixSeconds`](/gmt/reference/unix/validate/isValidUnixSeconds/): Return true when `timestamp` is a Unix seconds value every `unix/` function accepts.
- [`isValidUnixUnit`](/gmt/reference/unix/validate/isValidUnixUnit/): Return true when `unit` is a valid UnixUnit.
