Q:

Long Date (UNIX Date) issues

The problem is as follows : 
Quick details of the app : Sorting of data (ascending) according to the date.
The UNIX date / long date from the web service in form of JSON (is of 13 digits). When the long date is parsed, I get an invalid value of the date. 
Long date : 1428498595000
Converted date : Sun, 26 Apr 47237 13:16:40 (After parsing)
[Notice the year]
When the online converter is used (example) : http://www.onlineconversion.com/unix_time.htm , the same output is reproduced. 
My purpose is to get the dates sorted in ascending order, but unfortunately, as the year is shown irrelevant, it makes sorting impossible.
Long date 1428498595 (After manually removing three zeros to test it on the website) : Wed, 08 Apr 2015 13:09:55 GMT (This is the correct date that needs to be shown)
Can anyone help me understand what can be done so that we could manually remove the last three zeros?
[Storing the parsed data in SQLite and then producing the stored data in UITableView]
This is in AppDelegate
+(NSString * )convertUnixTime_to_SytemTime :(NSTimeInterval )timeInterval
{
    NSDate * convertedDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateFormat = @"YYYY-MM-DD";
    NSTimeZone *localTime = [NSTimeZone systemTimeZone];
    [dateFormatter setTimeZone:localTime];
    NSString *timeStamp = [dateFormatter stringFromDate:convertedDate];
    return timeStamp;
}

This is in the code
data.News_LastModifiedDate = [AppDelegate convertUnixTime_to_SytemTime:[[subcomponents objectAtIndex:2] doubleValue]];

Thanks much in advance.

A:

The date/time is in milliseconds since UNIX epoch, instead of seconds.  You can divide by 1000.0 in order to keep the fractional seconds (if they ever appear):
NSTimeInterval seconds = (NSTimeInterval)1428498595000 / 1000.0;

EDIT.  To address other aspects of your question:

Storing the parsed data in SQLite and then producing the stored data
  in UITableView

Store it as is; as a 64-bit int.

+(NSString * )convertUnixTime_to_SytemTime :(NSTimeInterval )timeInterval

This method doesn't convert the UNIX time to system time; it formats the date into a string (wrongly by the look of it).  Forget it and use just the first line of code only:
NSDate * convertedDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];

Where timeInterval is the original number converted to seconds as above.  The only time you want the date as a string is during presentation, not during processing.

