title: Objective C Timestamp
body: <p>I have found numerous timestamp conversions and they all work but the thing is, when I put my code to the text form of the date, I always come out 4 months ahead.</p>
  
  <p>This is pulling the current Day of Week, Date and Time.  I have it set this way cause I select the day with a DateTime Picker.  This is just my viewDidLoad to pull today's date.</p>
  
  <pre><code>NSDate *myDate = [[NSDate alloc] init];
  NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
  [dateFormat setDateFormat:@"cccc, MMMM dd, YYYY, hh:mm aa"];
  NSString *prettyVersion = [dateFormat stringFromDate:myDate];
  date.text = prettyVersion;
  </code></pre>
  
  <p>Now comes the timestamp conversion to take prettyVersion to timeIntervalSince1970</p>
  
  <pre><code>NSDate *startdates = [dateFormat dateFromString:prettyVersion];
  NSLog(@"Timestamp %0.0f",[startdates timeIntervalSince1970]);
  </code></pre>
  
  <p>NSLog outputs "Timestamp 1356317580" which when converted is Mon, 24 Dec 2012 02:53:00 GMT</p>
  
  <p>Now I can do this</p>
  
  <pre><code>          NSLog(@"Timestamp2  %0.0f",[myDate timeIntervalSince1970]);
  </code></pre>
  
  <p>and get the right timestamp.</p>
  
  <p>So where am i messing up at.</p>