Instance Method

isEqualToDate:

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

Declaration

- (BOOL)isEqualToDate:(NSDate *)otherDate;

Parameters

anotherDate

The date to compare with the receiver.

Return Value

YES if the anotherDate is an NSDate object and is exactly equal to the receiver, otherwise NO.

Discussion

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

See Also

Comparing Dates

- earlierDate:

Returns the earlier of the receiver and another given date.

- laterDate:

Returns the later of the receiver and another given date.

- compare:

Indicates the temporal ordering of the receiver and another given date.