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

# distance(to:)

Returns the distance from this date to another date, specified as a time interval.

## Declaration

```swift
func distance(to other: Date) -> TimeInterval
```

## Parameters

- `other`: Another date.

## Return Value

Return Value The distance from this date to the other date, as a TimeInterval.

## See Also

### Comparing Dates

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