Created
January 23, 2016 21:42
-
-
Save quellish/bf4645ca200be193c8fe to your computer and use it in GitHub Desktop.
numberOfDaysInThePast
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
| - (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