Objective-C:Unicode 日期格式
我正在尝试找出如何使用 UNICODE 表示 Sun, 03 May 2009 19:58:58 -0700 as eee, dd MMM yyyy HH:mm:s ZZZZ 或其他。我似乎无法让它精确地工作。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 NSDateFormatter 。它允许您使用 Unicode 规范,然后使用 stringFromDate:。另请考虑阅读有关 格式化日期。例子:
Use an NSDateFormatter. It lets you set a particular format string, using the format specifiers from the Unicode spec, then get the formatted date from a given NSDate object using stringFromDate:. Also consider reading Apple's doc about formatting dates. Example: