Created
June 16, 2011 14:35
-
-
Save AdamSwinden/1029341 to your computer and use it in GitHub Desktop.
Date with Time Component Removed
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*)dateWithTimeComponentRemoved:(NSDate *)date { | |
NSCalendar *calendar = [NSCalendar currentCalendar]; | |
NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:self]; | |
return [calendar dateFromComponents:components]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment