title: In Cocoa, how do I use NSTimeZone to get the system time zone offset as a string?
body: <p>For PDT, I would want "-0700".</p>
  
  <p>I'm getting a date in the past to determine how long ago something happened.</p>
  
  <pre><code>NSDate *then = [NSDate dateWithString:@"1976-04-01 12:34:56 -0700"]; // Note the hard-coded time zone at the end
  </code></pre>
  
  <p>I'll be constructing the date string elsewhere but I don't know how to access the local time zone.</p>
  
  <p>I read the Apple Dates and Times Programming Topics for Cocoa as well as the NSTimeZone and NSDate Class References but it's just too hard for me to put the information together. I could really use a few lines of code just to show how it's used.</p>
  
  <p><strong>Update</strong>: While struggling with this, I was writing code using a Command Line template so I could try things quickly. I just tried my previous code on iPhone and I'm getting <strong>NSDate may not respond to '+dateWithString:'</strong> Sorry if that added to the confusion, who knew Apple would change up such a basic class.</p>