Skip to content

Instance MethodFoundationEssentials

distance(to:)

iOS 13.0+ iPadOS 13.0+ Mac Catalyst 13.0+ macOS 10.15+ tvOS 13.0+ watchOS 6.0+
Returns the distance from this date to another date, specified as a time interval.
func distance(to other: Date) -> TimeInterval

Parameters

other

Another date.

Return Value

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