1、获取日期中的年、月、日、时、分、秒、周
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifi
NSDateComponents *comps = [[NSDateComponents alloc] init];
NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDate *now = [NSDate date];
comps = [calendar components:unitFlags fromDate:now];
week = [comps weekday]; month = [comps month]; day = [comps day]; hour = [comps hour];
min = [comps minute]; sec = [comps second];