How to turn a NSString into NSDate?

后端 未结 5 1304
攒了一身酷
攒了一身酷 2021-02-10 10:50

Ive been racking my brains with no luck. Could someone please tell me how i would convert this string:

\"2011-01-13T17:00:00+11:00\"

into a NSDate?

5条回答
  •  情书的邮戳
    2021-02-10 11:37

    Did you try this

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    NSDate *dateT = [dateFormatter dateFromString:str];
    

    Cheers

提交回复
热议问题