tags:

views:

451

answers:

2

Hi Guys

I have this "1273636800000"

I want this "Wed Mar 03 2010 00:00:00 GMT-0500 (EST)"

I need to convert this milliseconds to NSDate format.

I tried this

NSDate *tr = [NSDate dateWithTimeIntervalSince1970:1273636800000];

and

NSDate *tr = [NSDate dateWithTimeIntervalSinceReferenceDate:1273636800000];

and

NSDate *tr = [NSDate dateWithTimeIntervalSinceNow:1273636800000];

But I cat get it to work... anyone had thsi problem and found solution

V

+1  A: 

These functions (dateWithTimeIntervalSince1970, dateWithTimeIntervalSinceReferenceDate, dateWithTimeIntervalSinceNow) accept parameter in seconds.

You should pass 1273636800.000

Victor
Thanks that was really dumb of me... I spend like 3 hours thinking about it...
A: 

Divide by 1000 to get millis in seconds, that's what you want.

Thomas