obj-c for iOS 中日期格式模式的综合列表

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13862356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:32:47  来源:igfitidea点击:

Comprehensive list of date format patterns in obj-c for iOS

objective-ciosios6nsdateformatterdate-formatting

提问by chinabuffet

Is there an actual, comprehensive list of supported date format patterns/tokens? I've been looking at the API docs, and they mention a few of them, such as MM, but where's the rest?

是否有支持的日期格式模式/令牌的实际、全面的列表?我一直在查看API 文档,他们提到了其中的一些,例如MM,但其余的呢?

回答by Tommy

Apple imports the Unicode standard so the appendix that summarises date format fields is here.

Apple 导入了 Unicode 标准,因此总结日期格式字段的附录在这里

回答by Mike Weller

If you follow the links to the "Data Formatting Guide", you will see this information:

如果您点击“数据格式指南”的链接,您将看到以下信息:

The format string uses the format patterns from the Unicode Technical Standard #35. The version of the standard varies with release of the operating system:

  • Formatters in iOS 5.0-5.1 use version tr35-19.
  • Formatters in iOS 4.0-4.2 use version tr35-15.
  • Formatters in iOS 3.2 use version tr35-12.
  • Formatters in OS X v10.8 and iOS 6.0 use version tr35-25.
  • Formatters in OS X v10.7 and iOS 4.3 use version tr35-17.
  • Formatters in OS X v10.6 and iOS 3.0-3.1 use version tr35-10.

格式字符串使用来自 Unicode 技术标准 #35 的格式模式。该标准的版本随操作系统的发布而变化:

  • iOS 5.0-5.1 中的格式化程序使用版本tr35-19
  • iOS 4.0-4.2 中的格式化程序使用版本tr35-15
  • iOS 3.2 中的格式化程序使用版本tr35-12
  • OS X v10.8 和 iOS 6.0 中的格式化程序使用版本tr35-25
  • OS X v10.7 和 iOS 4.3 中的格式化程序使用版本tr35-17
  • OS X v10.6 和 iOS 3.0-3.1 中的格式化程序使用版本tr35-10