2013-07-12 31 views
-5

如何解析字符串「2013-06-13T05:47:03.737Z」使用NSDateFormatter的NSDate實例?我已經嘗試將dateFormatter的dateFormat屬性設置爲: 「yyyy」 - 'MM' - 'dd'T'HH':'mm':'ss'。'fffZ「,但是我變空了。我希望能跟大家能幫助如何解析字符串「2013-06-13T05:47:03.737Z」到NSDate對象

+0

歡迎到現場,這個問題已經被問和在這裏找到答案:(HTTP [以什麼格式是這個日期字符串?]://計算器。 com/questions/16218855/in-what-format-is-this-date-string)請在提問之前進行搜索,以便我們不會一遍又一遍地提出同樣的問題。 – lnafziger

+2

你在哪裏找到「fff」?你甚至看過[日期格式指南](http://www.unicode.org/reports/tr35/tr35-25.html#Date_Format_Patterns)? –

回答

2

試試這個

[dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"];