NSDate * senddate=[NSDate date]; NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init]; [dateformatter setDateFormat:@"yyyy"]; // 今年2016 NSStr ...
NSDate * senddate=[NSDate date];
NSDateFormatter *dateformatter=[[NSDateFormatter alloc] init];
[dateformatter setDateFormat:@"yyyy"];
// 今年2016
NSString *thisYearString=[dateformatter stringFromDate:senddate];