title: Format of date when retrieving lastModified
body: <p>I am comparing the date when a file was last modified for two files, one local and one on Amazon S3 server. I am using the AWS IOS SDK framework and can successfully request and receive response from the S3 server but I have trouble understanding the format of the returned s3 date. </p>
  
  <p>On my local machine the date format for lastModified is "2011-07-21 18:43:15 -0400" while for the file residing on the S3 server it is "2011-10-15T16:25:49.000Z".</p>
  
  <p>My local info is obtained using:  </p>
  
  <pre><code>    NSFileManager *fm  = [NSFileManager defaultManager];
      NSDictionary *attr = [fm attributesOfItemAtPath:filePath error:nil];
      NSDate *localDate  = [attr objectForKey:NSFileModificationDate];
  </code></pre>
  
  <p>while my S3 info is obtained using </p>
  
  <pre><code>    for (S3ObjectSummary *object in [listObjectsResult objectSummaries]) {
         NSDate *s3date = [object lastModified];
      }
  </code></pre>
  
  <p>Does anyone know if I can convert the date for the S3 file to a format that I can use to compare these two dates using: </p>
  
  <pre><code>    NSTimeInterval deltaSeconds = [s3Date timeIntervalSinceDate: localDate];
  </code></pre>
  
  <p>or am I doing something wrong here? Right now my program crashes with </p>
  
  <pre><code>    [NSCFString timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x200351360. 
  </code></pre>
  
  <p>probably because the s3 date format is not in proper format. I am quite new to using the AWS S3 SDK so all help is greatly appreciated. If anyone also knows of some good tutorials for this framework (apart from the demo code that comes with it), that would be great. Cheers, Trond</p>