我正在尝试找出如何使用 UNICODE 表示
Sun, 03 May 2009 19:58:58 -0700 as eee, dd MMM yyyy HH:mm:s ZZZZ 或其他。我似乎无法让它精确地工作。
Use an NSDateFormatter http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html。它允许您使用格式说明符来设置特定的格式字符串统一码规范 http://unicode.org/reports/tr35/tr35-6.html#Date_Format_Patterns,然后使用给定的 NSDate 对象获取格式化日期字符串起始日期: http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html#//apple_ref/doc/uid/20000447-CJBFIDDA。另请考虑阅读 Apple 的文档格式化日期 http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html#//apple_ref/doc/uid/TP40002369-SW1。例子:
// Given some NSDate *date
NSDateFormatter *formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setDateFormat:@"eee, dd MMM yyyy HH:mm:ss ZZZZ"];
NSString *formattedDate = [formatter stringFromDate:date];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)