I am receiving a string from the YouTube JSONC api, but the duration is coming as a full number i.e 2321 instead of 23:21 or 2 instead of 0:02. How would I go about fixing t
Here is the great code I finds for this
int duration = 1221;
int minutes = floor(duration/60)
int seconds = round(duration - (minutes * 60))
NSString * timeStr = [NSString stringWithFormat:@"%i:%i",minutes,seconds];
NSLog(@"Dilip timeStr : %@",timeStr);
And the output will belike this
Dilip timeStr : 20:21