开发者

Parsing date in Objective-C

How can 开发者_运维百科I parse this into an objective-c NSDate most efficiently?

"2010-07-13T11:22:33-07:00"

This is what I tried

NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"yyyy-MMM-dd'T'HH:mm:ssZ"];

but did not work


have a look here, i had that issue

"The format that I am being given is halfway between RFC 822 and GMT. if i change the "+00:00" to "+0000" then I can use the "Z" on my format. and if i change it to "GMT+00:00" then I can use ZZZZ to get the data properly. It seems that something has been stripped out to handle this hybrid as it was working for me before with OS 3.x"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜