What unit of time does timeIntervalSinceDate return?

Moshe picture Moshe · Jul 23, 2011 · Viewed 35.9k times · Source

What unit of time does timeIntervalSinceDate return? Is it seconds, milliseconds or something else?

The documentation says that it returns an NSTimeInterval, but what unit of time is that value?

Answer

esqew picture esqew · Jul 23, 2011

It returns the number of seconds, as an NSTimeInterval value.

From this documentation page:

NSTimeInterval is always specified in seconds; it yields sub-millisecond precision over a range of 10,000 years.