iphone how can i get month name from month number? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: iOS: How to get a proper Month name from a number? How can I get month name from month number? I have month number like 02 , but would like the month as a string, in this case February . 回答1: Something like this: int monthNumber = 11; NSString * dateString = [NSString stringWithFormat: @"%d", monthNumber]; NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MM"];