title: Convert an NSDate to a Unix timestamp using a particular time zone
body: <p>I am trying to get the Unix timestamp using a particular time zone (not necessarily the same time zone as the system)</p>
  
  <p>I tried this : </p>
  
  <pre><code> NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
  [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
  
  NSTimeZone *gmt = [NSTimeZone timeZoneWithName:@"Australia/Melbourne"];
  [dateFormatter setTimeZone:gmt];
  NSString *timeStamp = [dateFormatter stringFromDate:[NSDate date]];
  NSDate *curdate = [dateFormatter dateFromString:timeStamp];
  
  int unix_timestamp =  [curdate timeIntervalSince1970];
  </code></pre>
  
  <p>This should apparently, give the Unix timestamp (up to seconds) in Australia. However, when I log <code>curdate</code>, its still the time in GMT, <code>timeStamp</code> being the time in Australia/Melbourne. </p>
  
  <p>What could be the issue here?</p>