I have the following method below that is meant to retrieve and convert a unixTimeStamp from an API call to a NSDate object that I can easily manipulate and use. For some reason, this returns wrong values. An example would be when the unixTimeStamp is 1385152832, the date SHOULD be
Fri, 22 Nov 2013 20:40:31 GMT November 22, 2013 at 3:40:31 PM EST
but instead spits out: 45852-09-07 08:13:52 EST. Does anyone know why this would happen?
-(NSDate *)messageDate
{
NSTimeInterval unixTimeStamp = [[self messageDateString] doubleValue];
NSDate *messageDate = [NSDate dateWithTimeIntervalSince1970:unixTimeStamp];
NSAssert(messageDate, @"messageDate should not be nil");
return messageDate;
}