title: Why NSDateFormatter returns NULL on 24h locals with a 12h time setup?
body: <p>Hi Experts of the world,</p>
  
  <p>I ran into a very weird problem:</p>
  
  <p>I am formatting a string representing time from 00-23 (as returned by a Google service) in the following manner: </p>
  
  <p>(passing in a string of lets say 14, should output either 14:00 or 2:00 PM, depends on user local)</p>
  
  <pre><code>+(NSString *) formatTime: (NSString *)timeToBeFormatted {
  
     NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
     [dateFormat  setDateFormat:@"HH"];
     NSDate *date = [[NSDate alloc] init];
     date = [dateFormat dateFromString:timeToBeFormatted];  
  
     // Convert date object to desired output format
     [dateFormat setTimeStyle:NSDateFormatterShortStyle];
  
     timeToBeFormatted = [dateFormat stringFromDate:date];
     return timeToBeFormatted;
  }
  </code></pre>
  
  <p>Everything works fine in all locals worldwide. </p>
  
  <p>However, ONLY if a user has his TIME format set on 12h in a local where the default is 24h the formatter will return NULL ONLY for vales between 12-23.. Pretty weird i would say!</p>
  
  <p>Example:
  before formatter 12
   after 12:00 AM
  before formatter 13
   after (null)</p>
  
  <p>Any ideas why this could happen?</p>
  
  <p>Thanks!</p>