---
title: DateInterval
framework: foundation
role: symbol
role_heading: Structure
path: foundation/dateinterval
---

# DateInterval

The span of time between a specific start date and end date.

## Declaration

```swift
struct DateInterval
```

## Overview

Overview DateInterval represents a closed date interval in the form of [startDate, endDate].  It is possible for the start and end dates to be the same with a duration of 0.  DateInterval does not support reverse intervals i.e. intervals where the duration is less than 0 and the end date occurs earlier in time than the start date.

## Topics

### Creating a Date Interval

- [init()](foundation/dateinterval/init().md)
- [init(start:duration:)](foundation/dateinterval/init(start:duration:).md)
- [init(start:end:)](foundation/dateinterval/init(start:end:).md)

### Accessing Start Date, End Date, and Duration

- [start](foundation/dateinterval/start.md)
- [end](foundation/dateinterval/end.md)
- [duration](foundation/dateinterval/duration.md)

### Determining Intersections

- [intersection(with:)](foundation/dateinterval/intersection(with:).md)
- [intersects(_:)](foundation/dateinterval/intersects(_:).md)

### Determining Whether a Date Occurs Within a Date Interval

- [contains(_:)](foundation/dateinterval/contains(_:).md)

### Using Reference Types

- [NSDateInterval](foundation/nsdateinterval.md)

### Instance Methods

- [compare(_:)](foundation/dateinterval/compare(_:).md)

## Relationships

### Conforms To

- [Comparable](swift/comparable.md)
- [Copyable](swift/copyable.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomReflectable](swift/customreflectable.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [Hashable](swift/hashable.md)
- [IntentValueConvertible](appintents/intentvalueconvertible.md)
- [IntentValueExpressing](appintents/intentvalueexpressing.md)
- [ReferenceConvertible](foundation/referenceconvertible.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Date Representations

- [Date](foundation/date.md)
- [TimeInterval](foundation/timeinterval.md)
