title: Converting date of format yyyy-MM-dd'T'HH:mm:ss.SSS
body: <p>I have few <code>NSDate</code> objects which contain values compliant to this format <code>yyy-MM-dd'T'HH:mm:ss.SSS</code></p>
  
  <p>When I try to convert to a different format such as <code>MMM dd, yyyy HH:mm</code> the formatter always returns <code>nil</code>.</p>
  
  <p>However, if I hardcode the string value I get through the <code>NSDate</code> object , it is transformed to the new format without a problem. </p>
  
  <p>I populate my <code>NSDate</code> object in the model using the <code>setValue:forKey:</code> method, and I feel the problem is here where the JSON library passes a string value. However, the debugging shows that the <code>NSDate</code> has contains the value returned via JSON.</p>
  
  <p>Any idea what's causing this strange behavior?</p>
  
  <p>This is my conversion code:</p>
  
  <pre><code>NSDateFormatter *format = [[NSDateFormatter alloc] init];
  [format setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"];
  NSString *createdDateStr = [format stringFromDate:modelObj.createdDate];
  [format setDateFormat:@"MMM dd, yyyy HH:mm"];
  
  NSDate *formattedDate = [format dateFromString:createdDateStr];
  NSLog(@"========= REal Date %@",[format stringFromDate:formattedDate]);
  </code></pre>