NSTimeInterval
is actually just a typedef for double
.
NSDate
encapsulates a time interval and provides an interface to interact with it.
If you want that date to be referenced to our actual calendar, you have to use the NSCalendar
and NSDateComponents
classes.
NSDateComponents *components = [[NSCalendar currentCalendar] components:NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]];
Then you can get data out of the components object:
components.day
components.week
// etc
Assume the Mayan culture never went extinct. This right instant in time would be represented by the same NSDate object, but through a different NSCalendar
(like a NSMayanCalendar
) you would get a completely different representation of that date.