时分秒格式转化

2017-08-19  本文已影响0人  eb7a9dac29d0

- (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];

}

上一篇下一篇

猜你喜欢

热点阅读