How to turn a NSString into NSDate?

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

    You might check out TouchTime.

    https://github.com/jheising/TouchTime.

    It's a direct port of the awesome strtotime function in PHP in 5.4 for Cocoa and iOS. It will take in pretty much any arbitrary format of date or time string and convert it to an NSDate.

    Hope it works, and enjoy!

提交回复
热议问题