NSDate *currentDate = [NSDate date];//獲取當(dāng)前時間,日期
NSDateFormatter dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY年MM月"];
NSString dateString = [dateFormatter stringFromDate:currentDate];
NSCalendarcalendar = [NSCalendar currentCalendar];
NSDateComponentscomps;
comps = [calendar components:NSCalendarUnitWeekdayOrdinal|NSCalendarUnitMonth|NSCalendarUnitWeekday fromDate:currentDate];
NSInteger weekdayOrdinal = [currentDate xx_weekOfMonth]; // 這個月的第幾周