---
title: "earlierDate(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsdate/earlierdate(_:)"
---

# earlierDate(_:)

Returns the earlier of the receiver and another given date.

## Declaration

```swift
func earlierDate(_ anotherDate: Date) -> Date
```

## Parameters

- `anotherDate`: The date with which to compare the receiver.

## Return Value

Return Value The earlier of the receiver and anotherDate, determined using timeIntervalSince(_:). If the receiver and anotherDate represent the same date, returns the receiver.

## See Also

### Related Documentation

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

### Comparing Dates

- [isEqual(to:)](foundation/nsdate/isequal(to:).md)
- [laterDate(_:)](foundation/nsdate/laterdate(_:).md)
- [compare(_:)](foundation/nsdate/compare(_:).md)
