我不想给出输入日期的正确日期格式,所以请给我正确的输入日期格式。
这是我的示例代码和日期格式。
NSString *yourXMLDate = @"Thursday, September 9, 2010";
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
[inputFormatter setDateFormat:@"EEEE, MMMM dd, YYYY"]; // It doesnt work
---->[inputFormatter setDateFormat:@"EEEE, ????????????"];
NSDate *inputDate = [inputFormatter dateFromString:yourXMLDate];
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
[outputFormatter setDateFormat:@"MM/dd"];
NSString *outputDate = [outputFormatter stringFromDate:inputDate];
谢谢!
答案 0 :(得分:0)