---
title: "compare(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/date/compare(_:)"
---

# compare(_:)

Compares another date to this one.

## Declaration

```swift
func compare(_ other: Date) -> ComparisonResult
```

## Parameters

- `other`: Another date.

## See Also

### Comparing Dates

- [==(_:_:)](foundation/date/==(_:_:).md)
- [>(_:_:)](foundation/date/_(_:_:)-880ns.md)
- [<(_:_:)](foundation/date/_(_:_:)-42kro.md)
- [distance(to:)](foundation/date/distance(to:).md)
