# interval

Industry: Core

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

- [`clampInterval`](/gmt/reference/interval/calculate/clampInterval/): Return the part of `interval` that lies inside `bounds`, or null when none of it does.
- [`intersectIntervals`](/gmt/reference/interval/calculate/intersectIntervals/): Return the half-open interval two intervals share, or null when they share no instant.
- [`mergeIntervals`](/gmt/reference/interval/calculate/mergeIntervals/): Collapse a list of half-open intervals into the fewest sorted, non-overlapping intervals.
- [`splitIntervalAt`](/gmt/reference/interval/calculate/splitIntervalAt/): Split a half-open interval at instant boundaries into consecutive half-open pieces.
- [`subtractIntervals`](/gmt/reference/interval/calculate/subtractIntervals/): Return the parts of `from` that no interval in `remove` covers, as sorted half-open intervals.
- [`sumIntervals`](/gmt/reference/interval/calculate/sumIntervals/): Return the time covered by a list of half-open intervals, as an exact ISO 8601 duration.

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

- [`intervalContains`](/gmt/reference/interval/compare/intervalContains/): Return true when an ISO 8601 instant string lies inside a half-open interval.
- [`intervalsOverlap`](/gmt/reference/interval/compare/intervalsOverlap/): Return true when two half-open intervals share at least one instant.

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

- [`isValidInterval`](/gmt/reference/interval/validate/isValidInterval/): Validate whether a value is an `Interval` the `interval/` namespace accepts.
