How to turn a NSString into NSDate?

后端 未结 5 1316
攒了一身酷
攒了一身酷 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:36

    Try using this cocoapods enabled project. There are many added functions that will probably be needed as well.

    "A category to extend Cocoa's NSDate class with some convenience functions."

    https://github.com/billymeltdown/nsdate-helper

    Here's an example from their page:

    NSDate *date = [NSDate dateFromString:@"2009-03-01 12:15:23"];
    

提交回复
热议问题