美文网首页
iOS 秒换算成天时分秒

iOS 秒换算成天时分秒

作者: xu1Peng | 来源:发表于2021-04-22 11:18 被阅读0次

`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];}

```

相关文章

网友评论

      本文标题:iOS 秒换算成天时分秒

      本文链接:https://www.haomeiwen.com/subject/wcmxrltx.html