<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSDateInterval/isEqual(to:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDateInterval(im)isEqualToDateInterval:"
  },
  "title" : "isEqual(to:)"
}
-->

# isEqual(to:)

Indicates whether the receiver is equal to the specified date interval.

```
func isEqual(to dateInterval: DateInterval) -> Bool
```

## Parameters

`dateInterval`

The date interval with which to check the receiver for equality.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the [`startDate`](/documentation/Foundation/NSDateInterval/startDate) and [`duration`](/documentation/Foundation/NSDateInterval/duration) of `dateInterval` and the receiver are equal. Otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

---

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)