Created
January 23, 2016 21:43
-
-
Save quellish/ae31164fe4943b2cd679 to your computer and use it in GitHub Desktop.
numberOfDaysInThePast2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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