<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 10.0.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/DateInterval",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation12DateIntervalV"
  },
  "title" : "DateInterval"
}
-->

# DateInterval

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

```
struct DateInterval
```

## 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()`](/documentation/Foundation/DateInterval/init())

Initializes an interval with start and end dates set to the current date and the duration set to `0`.

[`init(start:duration:)`](/documentation/Foundation/DateInterval/init(start:duration:))

Initializes an interval with the specified start date and duration.

[`init(start:end:)`](/documentation/Foundation/DateInterval/init(start:end:))

Initializes an interval with the specified start and end date.

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

[`start`](/documentation/Foundation/DateInterval/start)

The start date.

[`end`](/documentation/Foundation/DateInterval/end)

The end date.

[`duration`](/documentation/Foundation/DateInterval/duration)

The duration.

### Determining Intersections

[`intersection(with:)`](/documentation/Foundation/DateInterval/intersection(with:))

Returns an interval that represents the interval where the given date interval and the current instance intersect.

[`intersects(_:)`](/documentation/Foundation/DateInterval/intersects(_:))

Indicates whether this interval intersects the specified interval.

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

[`contains(_:)`](/documentation/Foundation/DateInterval/contains(_:))

Indicates whether this interval contains the given date.

### Using Reference Types

[`NSDateInterval`](/documentation/Foundation/NSDateInterval)

An object representing the span of time between a specific start date and end date.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)