Piero
Piero

Reputation: 9273

convert time interval since reference to time interval since 1970

i want know if it's possible convert this time interval:

TimeIntervalSinceReferenceDate

to this time interval:

 TimeIntervalSince1970

without create a new NSDate, thanks!

Upvotes: 1

Views: 1558

Answers (1)

Dmitry Shevchenko
Dmitry Shevchenko

Reputation: 32414

I suppose you could calculate number of seconds between Jan 1, 1970 and Jan 1, 2001, and then just subtract it from your interval, but I don't see how's that any better than, say:

[[NSDate dateWithTimeIntervalSinceReferenceDate:timeInterval] timeIntervalSince1970];

Upvotes: 3

Related Questions