---
title: "isEqual(to:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsdate/isequal(to:)"
---

# isEqual(to:)

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

## Declaration

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

## Parameters

- `otherDate`: The date to compare with the receiver.

## Return Value

Return Value true if the otherDate is an NSDate object and is exactly equal to the receiver, otherwise false.

## Discussion

Discussion This method detects sub-second differences between dates. If you want to compare dates with a less fine granularity, use timeIntervalSince(_:) to compare the two dates.

## See Also

### Related Documentation

- [isEqual(_:)](objectivec/nsobjectprotocol/isequal(_:).md)

### Comparing Dates

- [earlierDate(_:)](foundation/nsdate/earlierdate(_:).md)
- [laterDate(_:)](foundation/nsdate/laterdate(_:).md)
- [compare(_:)](foundation/nsdate/compare(_:).md)
