title: NSDateComponents components:fromDate and Time Zones
body: <p>I have a method which extracts the hour and second components form a NSDate by breaking it down into its NSDateComponents.  My code is as follows...</p>
  
  <pre><code>unsigned hourAndMinuteFlags = NSHourCalendarUnit | NSMinuteCalendarUnit;
  NSCalendar* calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  [calendar setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];
  NSDateComponents* travelDateTimeComponents = [calendar components:hourAndMinuteFlags fromDate:travelDate];
  NSString* hours = [NSString stringWithFormat:@"%02i", [travelDateTimeComponents hour]];
  NSString* minutes = [NSString stringWithFormat:@"%02i", [travelDateTimeComponents minute]];
  </code></pre>
  
  <p>My problem is that I'm losing an hour in the conversion.  I have a suspicion that it's due to timezones but as far as I can see both the date being passed in and the calendar being used are both GMT.</p>
  
  <p>For example if I pass in the following NSDate object (this is a log of [NSDate description])...</p>
  
  <pre><code>2010-08-02 08:00:00 +0100
  </code></pre>
  
  <p>I expect that I get 8 for hours and 0 for minutes, but I actually get back 7 for my hours.  </p>
  
  <p>My system time is GMT, hence the NSDate above is currently +0100 for British Summer Time.</p>