title: Convert UTC time to PST for Daylight savings time?
body: <p>My application gets some time slots from backend and convert that into current time zone (PST) and display. Everything is working perfect until Day light time savings is kicking in.</p>
  
  <p>Is there a way in iOS to say like give me the PST date and time for this UTC and it will take care of Daylight savings day automatically. Currently its converting it fine but still giving me an hour off.</p>
  
  <p>Here's what i am doing:</p>
  
  <pre><code>-(NSDate *) toLocalTime:(NSDate*) currentDate
  {
      NSTimeZone *tz = [NSTimeZone timeZoneWithName:@"US/Pacific"];
      NSInteger seconds = [tz secondsFromGMTForDate: currentDate];
      return [NSDate dateWithTimeInterval: seconds sinceDate: currentDate];
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Changed my code to this but still the same result:</p>
  
  <pre><code>NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
      dateFormatter.dateFormat = @"MM/dd/yyyy HH:mm:ss";
      [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];
  
      NSString *startDateString = [[self.slotsArray objectAtIndex:indexPath.row] objectForKey:@"StartDate"];
      NSDate *startDate = [dateFormatter dateFromString:startDateString];
  
      dateFormatter.dateStyle = NSDateFormatterMediumStyle;
      dateFormatter.timeStyle = NSDateFormatterMediumStyle;
      [dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"America/Los_Angeles"]];
  
      NSString * dateString = [dateFormatter stringFromDate:startDate];
  </code></pre>
  
  <p>For example i am displaying some time slots for Mar 13 when the day light time kicks in. In UTC i am getting a time of 17:00 which is equivalent to 10 for us today. But the real time in this case will be 9 AM for that day. How should i fix that ?</p>