How to format convert the string 2013-01-27T02:31:47+08:00 into NSDate

后端 未结 2 1994
失恋的感觉
失恋的感觉 2020-12-21 23:31

I have tried many times to convert the string 2013-01-27T02:31:47+08:00 into NSDate. I have found the formatting guide by apple and copied its code and tried ,

2条回答
  •  伪装坚强ぢ
    2020-12-22 00:21

    Your format should be @"yyyy-MM-dd'T'HH:mm:ssZZZZZ". You only need single quotes around letters that are not going to be used by the formatter.

提交回复
热议问题