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.
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.
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;
Now comes the timestamp conversion to take prettyVersion to timeIntervalSince1970
NSDate *startdates = [dateFormat dateFromString:prettyVersion];
NSLog(@"Timestamp %0.0f",[startdates timeIntervalSince1970]);
NSLog outputs "Timestamp 1356317580" which when converted is Mon, 24 Dec 2012 02:53:00 GMT
Now I can do this
NSLog(@"Timestamp2 %0.0f",[myDate timeIntervalSince1970]);
and get the right timestamp.
So where am i messing up at.