Was not written to be used on a real timestamp, was written to be used counting up from 0.

int tmp = secondCount;

int _Days = tmp / (60 * 60 * 24);
tmp -= _Days * (60 * 60 * 24);
int _Hrs = tmp / (60 * 60);
tmp -= _Hrs * (60 * 60);
int _Min = tmp / 60;
tmp -= _Min * 60;
int _Sec = tmp;

NSString *displayString = [NSString stringWithFormat:@"%02i:%02i:%02i:%02i", _Days, _Hrs, _Min, _Sec];

Sorry, the comment form is closed at this time.

© 2012 James Border Suffusion theme by Sayontan Sinha