Created
March 21, 2013 19:34
-
-
Save inailuy/5216002 to your computer and use it in GitHub Desktop.
Convert Seconds to Minutes as a NSString
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)timeFormatted:(int)totalSeconds | |
{ | |
int seconds = totalSeconds % 60; | |
int minutes = (totalSeconds / 60) % 60; | |
int hours = totalSeconds / 3600; | |
return [NSString stringWithFormat:@"%02d:%02d:%02d",hours, minutes, seconds]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment