title: how to convert a unix timestamp into nsdate in iphone
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5827240/create-nsdate-from-unix-timestamp">Create NSDate from Unix timestamp</a>  </p>
  </blockquote>
  
  
  
  <p>I have an application where i am receiving date from json in unix timestamp format.This is the timestamp that i am receiving from json '1357178589630'.How to convert this timestamp into correct nsdate.I have used the following code for conversion but it is not working properly.This is my code: </p>
  
  <pre><code>double timestampval =  [[updates objectForKey:@"timestamp"] doubleValue];
  NSTimeInterval timestamp = (NSTimeInterval)timestampval;
  NSDate *updatetimestamp = [NSDate dateWithTimeIntervalSince1970:timestamp];
  </code></pre>
  
  <p>When the timestamp is converted to nsdate using datewithtimeIntervalSince1970,in the updatetimestamp variable it displays '44977-04-11 12:40:30 +0000'</p>