In Objective-C, to get the current hour and minute as integers, we need to use NSDateComponents and NSCalendar?
问题 I'd like to get the current hour and minute as integers. So if right now is 3:16am, I'd like to get the two integers: 3 and 16. But it looks like [NSDate date] will give the number of seconds since 1970, or it can give a string of the current time representation, but there is no easy way to get them as integers? I see a post in Getting current time, but it involved NSDateComponents and NSCalendar ? That's way too complicated... all that was need is something like NSDate *date = [NSDate date];