开发者

Storing hours/minutes in a way I can use with NSDate

I'm working on an app that is powered by a back-end API web service. There is an en开发者_开发技巧tity being used that has a few properties (such as name etc.) and it also has a time. The time is fixed in the sense its 10:00AM but its not date specific.

What do you think the best format would be for me to return this time from the API and be able to turn it into a set of NSDateComponents (NSHourCalendarUnit | NSMinuteCalendarUnit) easily and accurately.


You need an NSDateFormatter, from which you get an NSDate. Once you have the NSDate you can do what you want with it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜