title: GMT and UTC formatter with NSDateFormatter
body: <p>i wrote function that converting current time utc-gmt or gmt -utc. The functions just works fine if msgArrivedDate is null. If it's not ( that means , msgArrivedDate comes from rest service  that doses not convert .</p>
  
  <p>jSON parse part :</p>
  
  <pre><code>NSArray *messageSentTime = [[args valueForKey:@"messageSendDate"] objectAtIndex:0];
  
      for(int i=0 ;i&lt; [messageSentTime count]; i++)
      {
          //[self timeZoneFormatter:@"GMT" :[messageSentTime objectAtIndex:i]];
  
          NSLog(@"Converted time = %@",[self timeZoneFormatter:@"GMT" :[messageSentTime objectAtIndex:i]]);
  </code></pre>
  
  <p>Function part :</p>
  
  <pre><code>-(id)timeZoneFormatter:(NSString *)formatType : (NSString *)msgArrivedDate
  {
      NSDate *date;
  
      NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  
      [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  
  
      if([msgArrivedDate length] &gt; 0)
      {
  
          date = [dateFormatter dateFromString:msgArrivedDate];
  
      } else {
  
          date = [NSDate date];
      }
  
  
      if([formatType isEqualToString:@"UTC"])
      {
          [dateFormatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
  
      }
  
      if([formatType isEqualToString:@"GMT"])
      {
          [dateFormatter setTimeZone:[NSTimeZone localTimeZone]];
  
      }
  
      NSString *dateString = [dateFormatter stringFromDate:date];
  
      return dateString;
  }
  </code></pre>
  
  <p>ReST  returned me to these values in UTC format :</p>
  
  <blockquote>
  <pre><code>"2013-09-24 15:03:17",
  "2013-09-25 12:09:22",
  "2013-09-25 13:07:45",
  "2013-09-25 13:08:19",
  "2013-09-25 14:22:38"
  </code></pre>
  </blockquote>
  
  <p>When i call the function, <code>(NSLog(@"Converted time = %@",[self timeZoneFormatter:@"GMT" :[messageSentTime objectAtIndex:i]]))</code> returns :</p>
  
  <pre><code> messageSentTime = (
      "2013-09-24 15:03:17",
      "2013-09-25 12:09:22",
      "2013-09-25 13:07:45",
      "2013-09-25 13:08:19",
      "2013-09-25 14:22:38" )
  </code></pre>
  
  <p>I think i am just missing little issue over here :( couldn't find yet ...</p>