Skip to content

Instantly share code, notes, and snippets.

@quellish
Created January 23, 2016 21:42
Show Gist options
  • Select an option

  • Save quellish/bf4645ca200be193c8fe to your computer and use it in GitHub Desktop.

Select an option

Save quellish/bf4645ca200be193c8fe to your computer and use it in GitHub Desktop.
numberOfDaysInThePast
- (NSInteger) numberOfDaysInThePast{
NSInteger result = 0;
NSDate *now = [NSDate date];
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