Instance Method

timeIntervalSinceDate:

Returns the interval between the receiver and another given date.

Declaration

- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate;

Parameters

anotherDate

The date with which to compare the receiver. You must pass a non-nil date object.

Return Value

The interval between the receiver and the anotherDate parameter. If the receiver is earlier than anotherDate, the return value is negative. If anotherDate is nil, the results are undefined.

See Also

Getting Time Intervals

timeIntervalSinceNow

The interval between the date object and the current date and time.

timeIntervalSinceReferenceDate

The interval between the date object and 00:00:00 UTC on 1 January 2001.

timeIntervalSince1970

The interval between the date object and 00:00:00 UTC on 1 January 1970.

timeIntervalSinceReferenceDate

The interval between 00:00:00 UTC on 1 January 2001 and the current date and time.

NSTimeIntervalSince1970

The number of seconds from 1 January 1970 to the reference date, 1 January 2001.

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