What unit of time returns timeIntervalSinceDate?

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

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

+62
objective-c nsdate
Jul 22 '11 at 10:45
source share
2 answers

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

From this documentation page :

NSTimeInterval is always specified in seconds; it gives submillisecond accuracy over 10,000 years.

+79
Jul 22 2018-11-22T00:
source share

Well NSDate docs shows a function prototype as:

- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate

And the basic doc data types states:

NSTimeInterval is always specified in seconds; this gives submillisecond accuracy over 10,000 years.

+6
Jul 22 2018-11-22T00:
source share



All Articles