title: In Objective-C, to get the current hour and minute as integers, we need to use NSDateComponents and NSCalendar?
body: <p>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.</p>
  
  <p>But it looks like <code>[NSDate date]</code> 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?</p>
  
  <p>I see a post in <a href="https://stackoverflow.com/questions/9317320/getting-current-time">Getting current time</a>, but it involved <code>NSDateComponents</code> and <code>NSCalendar</code>?  That's way too complicated... all that was need is something like </p>
  
  <pre><code>NSDate *date = [NSDate date];
  int hour = [date getHour];     // which is not possible
  </code></pre>
  
  <p>Is there a simpler way than using 3 classes <code>NSDate</code>, <code>NSDateComponents</code>, and <code>NSCalendar</code> to get the current hour as an integer, or typically, in Objective-C, would we typically still use C language's <code>localtime</code> and <code>tm</code> to get the hour as an integer?</p>