How do I get the NSDateComponents of a single NSDate? I don\'t want the components of the difference between 2 dates, just the seconds, minutes, hours, day, month and year o
using NSCalendar's method:
- (NSDateComponents *)components:(NSUInteger)unitFlags fromDate:(NSDate *)date
like:
unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
NSDate *date = [NSDate date];
NSCalendar * cal = [NSCalendar currentCalendar];
NSDateComponents *comps = [cal components:unitFlags fromDate:date];