iOS 秒换算成天时分秒
2021-04-22 本文已影响0人
xu1Peng
`Hello world!`
```
- (NSString*)timeFormatted:(int)totalSeconds{ intdays = totalSeconds/(24*3600); intseconds = totalSeconds %60; intminutes = (totalSeconds /60) %60; inthours = (totalSeconds /3600) %24; return[NSStringstringWithFormat:@"%d天%d小时%d分%d秒",days,hours, minutes, seconds];}
```