Use two instances of NSDate to figure out how many seconds you have been alive. Hint: here is how you create a new date object from the year, month, etc.:
NSDateComponents *comps = [[NSDateComponents alloc] init]; [comps setYear:1969]; [comps setMonth:4]; [comps setDay:30]; [comps setHour:13]; [comps setMinute:10]; [comps setSecond:0]; NSCalendar *g = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *dateOfBirth = [g dateFromComponents:comps];
To get the number of seconds between two instances of NSDate, use the method timeIntervalSinceDate:.
double d = [laterDate timeIntervalSinceDate:earlierDate];