I want to know how to convert seconds to minutes and days according to the URL am getting via web-service-
I have to use those seconds as to display user's last activity-
how can I do that???
I want to know how to convert seconds to minutes and days according to the URL am getting via web-service-
I have to use those seconds as to display user's last activity-
how can I do that???
I use this method to get total hour,minutes and seconds for my audio or video player to display duration of it. Method is like,
- (NSString *)timeFormatted:(int)totalSeconds
{
int seconds = totalSeconds % 60;
int minutes = (totalSeconds / 60) % 60;
int hours = totalSeconds / 3600;
NSString *finalString;
if (hours > 0) {
finalString = [NSString stringWithFormat:@"%02d:%02d:%02d",hours, minutes, seconds];
}
else{
finalString = [NSString stringWithFormat:@"%02d:%02d", minutes, seconds];
}
return finalString;
}
you can make method something like this.
hint :
You can get days something like,
int days = totalSeconds / 86400;