NSDateFormatter +dateFormatFromTemplate:options:locale: BUG?

后端 未结 1 1372
滥情空心
滥情空心 2020-12-16 19:10

Please see below codes and output.

 NSDateComponents *dateComponents = [[[NSDateComponents alloc] init] autorelease];
 [dateComponents setYear:2011];
 [dateC         


        
相关标签:
1条回答
  • 2020-12-16 19:33

    The template format string should be @"yyyyMMMd" (lowercase "y" for year).

    Uppercase "Y" is something else (see Unicode Date Format Patterns).

    0 讨论(0)
提交回复
热议问题