我可以在我的应用程序中看到一个非常奇怪的日期转换。这是代码:
theDateString = [theDateFormatter stringFromDate:date];
如果date是2007-12-31 00:00:00 +0100
theDateString_2008
但如果日期2004-12-31 00:00:00 +0100
theDateString是2004.
该方法- (NSString *)stringFromDate:(NSDate *)date在NSDateFormatter,它是一个mac应用程序。
NSDateFormatter 格式为:[theDateFormatter setDateFormat:@"Y"];
为什么 ?谢谢