Cocoa touch 在哪里可以找到NSDateFormatter可用的格式字符串模式表?

Cocoa touch 在哪里可以找到NSDateFormatter可用的格式字符串模式表?,cocoa-touch,cocoa,datetime,string-formatting,date-formatting,Cocoa Touch,Cocoa,Datetime,String Formatting,Date Formatting,NSDateFormatter实例的日期和时间格式可以设置为: [formatter setDateFormat: formatString]; 或者,您可以使用以下命令本地化格式字符串: [formatter setDateFormat: [NSDateFormatter dateFormatFromTemplate: formatStringWithPatterns options: 0 locale: [NSLocale currentLocale]];

NSDateFormatter实例的日期和时间格式可以设置为:

[formatter setDateFormat: formatString];
或者,您可以使用以下命令本地化格式字符串:

[formatter setDateFormat:
  [NSDateFormatter
    dateFormatFromTemplate: formatStringWithPatterns
    options: 0 
    locale: [NSLocale currentLocale]];

但是,哪里有一个方便的表格,其中列出了格式字符串中可以使用的所有代码,并给出了每个代码的输出示例?

我刚刚从苹果的文档中取出了这个,因为我在需要的时候永远找不到它。希望S.O.能更好地联系起来

对于最新版本的iOS和OS X,答案是:

  • OS X v10.8+和iOS 6.0+中的格式化程序使用版本
对于以前的版本,您需要更仔细地查看:

  • iOS 5.0-5.1中的格式化程序使用版本
  • OS X v10.7和iOS 4.3中的格式化程序使用版本
  • iOS 4.0-4.2中的格式化程序使用版本
  • iOS 3.2中的格式化程序使用版本
  • OS X v10.6和iOS 3.0-3.1中的格式化程序使用版本