title: objective c: converting iso 8601 date time to local date time
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2201216/is-there-a-simple-way-of-converting-an-iso8601-timestamp-to-a-formatted-nsdate">Is there a simple way of converting an ISO8601 timestamp to a formatted NSDate?</a><br>
    <a href="https://stackoverflow.com/questions/5185230/converting-an-iso-8601-timestamp-into-an-nsdate-how-does-one-deal-with-the-utc">Converting an ISO 8601 timestamp into an NSDate: How does one deal with the UTC time offset?</a>  </p>
  </blockquote>
  
  
  
  <p>i'm trying to convert date time which is in iso 8601 format int local time.
  convert this:</p>
  
  <pre><code>2012-10-15T09:46:16+02:00
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>2012-10-15 11:46:16
  </code></pre>
  
  <p>i try the following code but gives null back</p>
  
  <pre><code>NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZZZ"];
  NSDate *dt = [dateFormatter dateFromString:@"2012-10-15T09:46:16+02:00"];
  NSString *dateTime= [NSDateFormatter localizedStringFromDate:dt dateStyle:NSDateFormatterShortStyle timeStyle:NSDateFormatterShortStyle];
  NSLog(@"DATE FORMAT:%@", dateTime);
  </code></pre>
  
  <p>any idea what am i doing wrong?</p>