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

# isEqual(to:)

Returns a Boolean value that indicates whether a given object is a date that is exactly equal the receiver.

```
func isEqual(to otherDate: Date) -> Bool
```

## Parameters

`otherDate`

The date to compare with the receiver.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the `otherDate` is an [`NSDate`](/documentation/Foundation/NSDate) object and is exactly equal to the receiver, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method detects sub-second differences between dates. If you want to compare dates with a less fine granularity, use [`timeIntervalSince(_:)`](/documentation/Foundation/NSDate/timeIntervalSince(_:)) to compare the two dates.

## See Also

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:)>



---

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)