Instance Method


Returns the earlier of the receiver and another given date.


func earlierDate(_ anotherDate: Date) -> Date



The date with which to compare the receiver.

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

Comparing Dates

func isEqual(to: Date) -> Bool

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

func laterDate(Date) -> Date

Returns the later of the receiver and another given date.

func compare(Date) -> ComparisonResult

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software