【发布时间】:2014-09-19 02:00:04
【问题描述】:
来自我的数据源的字符串格式如下:
2011-04-11 23:12:05
// dateString comes from my data source, and look like I've said like this.
dateString = @"2011-04-11 23:12:05";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MMMM"];
NSDate *date = [formatter dateFromString:dateString];
当我在互联网上搜索此类主题时,答案始终是 dateString 格式错误。但是我的 dateString 是正确的之一,对吧?
为什么日期返回 nil?
【问题讨论】:
标签: objective-c nsdateformatter