Skip to content

Instantly share code, notes, and snippets.

@quellish
Created January 23, 2016 21:43
Show Gist options
  • Save quellish/ae31164fe4943b2cd679 to your computer and use it in GitHub Desktop.
Save quellish/ae31164fe4943b2cd679 to your computer and use it in GitHub Desktop.
numberOfDaysInThePast2
- (NSDate *) currentDate {
return [NSDate date];
}
- (NSInteger) numberOfDaysInThePast{
NSInteger result = 0;
NSDate *now = [self currentDate];
NSTimeInterval diff = 0;
diff = [now timeIntervalSinceDate:[self eventDate]];
result = diff / (24 * 60 * 60);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment