title: How to convert a date string like "2011-01-12T14:17:55.043Z" to a long like 1294841716?
body: <p>I need to convert a date in this string format:</p>
  
  <p>"2011-01-12T14:17:55.043Z"</p>
  
  <p>to a number like 1294841716 (which is the number of seconds [not milliseconds] since Jan. 1st, 1970).  Is there an easy way to do this parsing?</p>
  
  <p><strong>Update:</strong> Here is the code I've got so far:</p>
  
  <pre><code>NSString *dateString = @"2011-01-12T14:17:55.043Z";
  NSDateFormatter *inFormat = [[NSDateFormatter alloc] init];
  [inFormat setDateFormat:@"yyyy-MM-ddTHH:mm:ss.nnnZ"];
  NSDate *parsed = [inFormat dateFromString:dateString];
  long t = [parsed timeIntervalSinceReferenceDate];
  </code></pre>
  
  <p>But <code>t</code> comes back as 0 every time.</p>