# @northguild/gmt/unix > Unix timestamps in seconds or milliseconds, as strings: arithmetic, comparison, formatting, parsing and conversion. Back to the [root llms.txt](https://northguild.dev/gmt/llms.txt). ## calculate - [addUnix](https://northguild.dev/gmt/reference/unix/calculate/addUnix.md): Add a temporal amount to a Unix epoch value and return the resulting epoch. - [diffUnix](https://northguild.dev/gmt/reference/unix/calculate/diffUnix.md): Return the difference between two Unix timestamps measured in the given unit. - [diffUnixAsDuration](https://northguild.dev/gmt/reference/unix/calculate/diffUnixAsDuration.md): Return the difference between two Unix timestamps as an ISO 8601 duration string, bridging to the `duration` namespace (see `parseDuration`, `normalizeDuration`). - [endOfQuarterForUnix](https://northguild.dev/gmt/reference/unix/calculate/endOfQuarterForUnix.md): Return the end of the quarter for a Unix timestamp. - [endOfUnix](https://northguild.dev/gmt/reference/unix/calculate/endOfUnix.md): Return the end of the specified unit for a Unix timestamp. - [isBetweenUnix](https://northguild.dev/gmt/reference/unix/calculate/isBetweenUnix.md): Return true when the Unix timestamp is between start and end (inclusive by default). - [maxUnix](https://northguild.dev/gmt/reference/unix/calculate/maxUnix.md): Return the latest (maximum) of the given Unix timestamp values. - [minUnix](https://northguild.dev/gmt/reference/unix/calculate/minUnix.md): Return the earliest (minimum) of the given Unix timestamp values. - [roundUnix](https://northguild.dev/gmt/reference/unix/calculate/roundUnix.md): Round a Unix timestamp to the specified unit. - [secondsUntilUnix](https://northguild.dev/gmt/reference/unix/calculate/secondsUntilUnix.md): Return the whole seconds from now until a stored Unix epoch, such as a JWT `exp`. - [setUnix](https://northguild.dev/gmt/reference/unix/calculate/setUnix.md): Return a Unix epoch value with the given `fields` set on `value`, interpreted in `timeZone`. - [sortUnix](https://northguild.dev/gmt/reference/unix/calculate/sortUnix.md): Sort an array of Unix timestamp values in ascending or descending order. - [startOfQuarterForUnix](https://northguild.dev/gmt/reference/unix/calculate/startOfQuarterForUnix.md): Return the start of the quarter for a Unix timestamp. - [startOfUnix](https://northguild.dev/gmt/reference/unix/calculate/startOfUnix.md): Return the start of the specified unit for a Unix timestamp. - [subtractUnix](https://northguild.dev/gmt/reference/unix/calculate/subtractUnix.md): Subtract a temporal amount from a Unix epoch value and return the resulting epoch. ## compare - [areUnixEqual](https://northguild.dev/gmt/reference/unix/compare/areUnixEqual.md): Return whether `value1` and `value2` represent the same instant. - [areUnixEqualBy](https://northguild.dev/gmt/reference/unix/compare/areUnixEqualBy.md): Compare two Unix epoch values for equality at a given unit. - [isAfterUnix](https://northguild.dev/gmt/reference/unix/compare/isAfterUnix.md): Return whether `value1` represents an instant strictly after `value2`. - [isBeforeUnix](https://northguild.dev/gmt/reference/unix/compare/isBeforeUnix.md): Return whether `value1` represents an instant strictly before `value2`. ## convert - [convertUnixToPlainDate](https://northguild.dev/gmt/reference/unix/convert/convertUnixToPlainDate.md): Convert a Unix timestamp to a plain date string in the format "YYYY-MM-DD". - [convertUnixToPlainDateTime](https://northguild.dev/gmt/reference/unix/convert/convertUnixToPlainDateTime.md): Convert a Unix timestamp to a plain datetime string in the format "YYYY-MM-DDTHH:mm:ss". - [convertUnixToPlainTime](https://northguild.dev/gmt/reference/unix/convert/convertUnixToPlainTime.md): Convert a Unix timestamp to a plain time string in the format "HH:mm:ss". - [convertUnixToUtc](https://northguild.dev/gmt/reference/unix/convert/convertUnixToUtc.md): Convert a unix epoch value to a UTC Instant ISO string. - [convertUnixToZoned](https://northguild.dev/gmt/reference/unix/convert/convertUnixToZoned.md): Convert a unix epoch value to a zoned ISO 8601 datetime string. ## format - [formatCalendarUnix](https://northguild.dev/gmt/reference/unix/format/formatCalendarUnix.md): 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`. See that function's JSDoc for the day-label/threshold/connector design; this variant compares calendar days and renders the clock time in `timeZone`. - [formatRelativeUnix](https://northguild.dev/gmt/reference/unix/format/formatRelativeUnix.md): Format the relative time between a unix epoch value and a reference instant. - [formatUnix](https://northguild.dev/gmt/reference/unix/format/formatUnix.md): Format a unix epoch value (string or number) as a localized date/time string. ## get - [getUnixAgo](https://northguild.dev/gmt/reference/unix/get/getUnixAgo.md): Return the Unix epoch before now, counted from the current time in UTC. - [getUnixDay](https://northguild.dev/gmt/reference/unix/get/getUnixDay.md): Return the current day from the Unix timestamp in UTC as a zero-padded string. - [getUnixHour](https://northguild.dev/gmt/reference/unix/get/getUnixHour.md): Return the current hour from the Unix timestamp in UTC as a zero-padded string. - [getUnixIn](https://northguild.dev/gmt/reference/unix/get/getUnixIn.md): Return the Unix epoch after now, counted from the current time in UTC. - [getUnixMicrosecond](https://northguild.dev/gmt/reference/unix/get/getUnixMicrosecond.md): Return the current microsecond from the Unix timestamp in UTC as a zero-padded string. - [getUnixMillisecond](https://northguild.dev/gmt/reference/unix/get/getUnixMillisecond.md): Return the current millisecond from the Unix timestamp in UTC as a zero-padded string. - [getUnixMinute](https://northguild.dev/gmt/reference/unix/get/getUnixMinute.md): Return the current minute from the Unix timestamp in UTC as a zero-padded string. - [getUnixMonth](https://northguild.dev/gmt/reference/unix/get/getUnixMonth.md): Return the current month from the Unix timestamp in UTC as a zero-padded string. - [getUnixNanosecond](https://northguild.dev/gmt/reference/unix/get/getUnixNanosecond.md): Return the current nanosecond from the Unix timestamp in UTC as a zero-padded string. - [getUnixNow](https://northguild.dev/gmt/reference/unix/get/getUnixNow.md): Return the current Unix timestamp in either seconds or milliseconds. - [getUnixNowUnit](https://northguild.dev/gmt/reference/unix/get/getUnixNowUnit.md): Return the requested unit value from the current Unix timestamp in UTC. - [getUnixSecond](https://northguild.dev/gmt/reference/unix/get/getUnixSecond.md): Return the current second from the Unix timestamp in UTC as a zero-padded string. - [getUnixYear](https://northguild.dev/gmt/reference/unix/get/getUnixYear.md): Return the current year from the Unix timestamp in UTC as a zero-padded string. ## interval - [intervalAbutsUnix](https://northguild.dev/gmt/reference/unix/interval/intervalAbutsUnix.md): 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](https://northguild.dev/gmt/reference/unix/interval/intervalContainsUnix.md): 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](https://northguild.dev/gmt/reference/unix/interval/intervalCountUnix.md): Count how many `unit` boundaries a Unix epoch interval crosses. - [intervalDifferenceUnix](https://northguild.dev/gmt/reference/unix/interval/intervalDifferenceUnix.md): Return the portion(s) of the half-open interval A `[aStart, aEnd)` not covered by the half-open interval B `[bStart, bEnd)`. - [intervalDivideEquallyUnix](https://northguild.dev/gmt/reference/unix/interval/intervalDivideEquallyUnix.md): Split a Unix epoch interval into `n` equal-length sub-intervals. - [intervalEngulfsUnix](https://northguild.dev/gmt/reference/unix/interval/intervalEngulfsUnix.md): 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](https://northguild.dev/gmt/reference/unix/interval/intervalFromDurationUnix.md): Construct a Unix epoch interval from a single point plus an ISO 8601 duration, anchored at either end. - [intervalIntersectionUnix](https://northguild.dev/gmt/reference/unix/interval/intervalIntersectionUnix.md): Return the overlapping span of two half-open Unix epoch intervals `[start, end)`, or null when they do not overlap. - [intervalLengthUnix](https://northguild.dev/gmt/reference/unix/interval/intervalLengthUnix.md): Return the exact length of a Unix epoch interval in `unit`, as a real (possibly fractional) number. - [intervalOverlappingDaysUnix](https://northguild.dev/gmt/reference/unix/interval/intervalOverlappingDaysUnix.md): Return how many distinct calendar dates two Unix epoch intervals share, in a given time zone. - [intervalsOverlapUnix](https://northguild.dev/gmt/reference/unix/interval/intervalsOverlapUnix.md): Return true when the half-open intervals `[aStart, aEnd)` and `[bStart, bEnd)` share at least one instant. - [intervalSplitAtUnix](https://northguild.dev/gmt/reference/unix/interval/intervalSplitAtUnix.md): Split a Unix epoch interval at arbitrary `points`, producing consecutive sub-intervals. - [intervalUnionUnix](https://northguild.dev/gmt/reference/unix/interval/intervalUnionUnix.md): 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](https://northguild.dev/gmt/reference/unix/interval/intervalXorAllUnix.md): 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](https://northguild.dev/gmt/reference/unix/interval/intervalXorUnix.md): Return the symmetric difference of two half-open Unix intervals `[start, end)` — the values covered by exactly one interval. - [isValidUnixInterval](https://northguild.dev/gmt/reference/unix/interval/isValidUnixInterval.md): Return true if `start` and `end` form a valid Unix interval — both safe-integer epochs and `start <= end`. - [mergeIntervalsUnix](https://northguild.dev/gmt/reference/unix/interval/mergeIntervalsUnix.md): Collapse a list of Unix epoch intervals into the minimum set of non-overlapping intervals. - [splitIntervalByUnitUnix](https://northguild.dev/gmt/reference/unix/interval/splitIntervalByUnitUnix.md): Split a Unix epoch interval into sub-intervals of `amount × unit`. ## parse - [parseDateFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseDateFromUnix.md): Extract the date portion from a unix epoch value. - [parseDayFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseDayFromUnix.md): Return the day of month (1-31) from a unix epoch value. - [parseDayOfWeekFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseDayOfWeekFromUnix.md): Return the day of week (1-7) from a unix epoch value. - [parseHourFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseHourFromUnix.md): Return the hour (0-23) from a unix epoch value. - [parseMicrosecondFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseMicrosecondFromUnix.md): Return the microsecond (0-999) from a unix epoch value. - [parseMillisecondFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseMillisecondFromUnix.md): Return the millisecond (0-999) from a unix epoch value. - [parseMinuteFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseMinuteFromUnix.md): Return the minute (0-59) from a unix epoch value. - [parseMonthFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseMonthFromUnix.md): Return the month (1-12) from a unix epoch value. - [parseNanosecondFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseNanosecondFromUnix.md): Return the nanosecond (0-999) from a unix epoch value. - [parseSecondFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseSecondFromUnix.md): Return the second (0-59) from a unix epoch value. - [parseTimeFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseTimeFromUnix.md): Extract the time portion from a unix epoch value. - [parseUnitFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseUnitFromUnix.md): Extract a unit from a unix epoch value. - [parseWeekFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseWeekFromUnix.md): Return the week number from a unix epoch value. - [parseYearFromUnix](https://northguild.dev/gmt/reference/unix/parse/parseYearFromUnix.md): Return the year from a unix epoch value. ## validate - [isValidUnixMilliseconds](https://northguild.dev/gmt/reference/unix/validate/isValidUnixMilliseconds.md): Return true when `timestamp` is a Unix milliseconds value every `unix/` function accepts. - [isValidUnixRange](https://northguild.dev/gmt/reference/unix/validate/isValidUnixRange.md): Return true if `value1` and `value2` form a valid Unix range — both safe-integer epochs and `value1 < value2` (or `<=` with `allowEqual`). - [isValidUnixSeconds](https://northguild.dev/gmt/reference/unix/validate/isValidUnixSeconds.md): Return true when `timestamp` is a Unix seconds value every `unix/` function accepts. - [isValidUnixUnit](https://northguild.dev/gmt/reference/unix/validate/isValidUnixUnit.md): Return true when `unit` is a valid UnixUnit. - [UnixUnit](https://northguild.dev/gmt/reference/types/UnixUnit.md): Unit accepted by `epochUnit` in unix-epoch functions. Determines whether a numeric value is interpreted as milliseconds or seconds.