0
我不會給出正確的日期格式的輸入日期,所以請給我正確的輸入日期格式。如何在iphone中輸入正確的輸入日期格式?
這裏我的示例代碼和日期格式。
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];
謝謝!
此鏈接不起作用。 – EpokK 2013-06-26 06:57:55