title: NSDate dateWithTimeIntervalSince1970 NOT returning GMT/UTC time
body: <p>I tried an experiment because I need to be able to generate a unix timestamp (since 1970) in the app I am working on.  </p>
  
  <pre><code>NSLog(@"Getting timeIntervalSince1970");
      double theLoggedInTokenTimestampDateEpochSeconds = [[NSDate date] timeIntervalSince1970];
  </code></pre>
  
  <p>This <strong>should've</strong> returned epoch seconds (since 1970) in GMT (Seconds since Jan 1, 1970).  However, when conducting the experiment at at Mon Aug 15 09:54:30 2011, it returned 1313427270.504315</p>
  
  <p>Testing this with a simple perl one-liner on my Mac OS Terminal, I get:
  <code>perl -e 'print scalar(localtime(1313427270))'</code> which returns <strong>Mon Aug 15 09:54:30 2011</strong> ... </p>
  
  <p>This is obviously not GMT time when I am in the SF Bay Area and my local timezone is set to "Cupertino".  What is going on and how do I fix it please?  I need to have my app send UTC time to the server when it communicates so wherever the user is time timestamp would be sent in one equal, valid time zone.</p>
  
  <p>In another part of my app, when the user requests data from the server, it gets it sent in UTC -- converting it to be displayed as follows:</p>
  
  <pre><code>NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  [dateFormatter setLocale:[NSLocale currentLocale]];
      [dateFormatter setTimeZone:nil];
      [dateFormatter setDateFormat:@"yyyyMMdd"];
      NSDate *conversationDate = [NSDate dateWithTimeIntervalSince1970:[theConversationTimeStampString intValue]];
      NSString *conversationDateString = [dateFormatter stringFromDate:conversationDate];
      [dateFormatter release];
  </code></pre>
  
  <p>and this works beautifully -- displaying the corrected time in the user's timezone and locale... so I know it is being done for incoming timestamps.  So, what am I doing wrong with the first function (timeIntervalSince190) that stops it from being in GMT?</p>
  
  <p>Thx</p>