- (NSString *)getResponseTimeWithString:(NSString *)handleTime {
NSString result = @"";
int totalSeconds = [handleTime intValue];
int day = totalSeconds/(360024);
int hours = (totalSeconds/3600) % 24;
int minutes = (totalSeconds/60) % 60;
int seconds = totalSeconds%60;
if (day >= 1) {
result = [NSString stringWithFormat:@"%d天%d小时%d分钟",day,hours,minutes];
} else if (hours >= 1 && hours < 24) {
result = [NSString stringWithFormat:@"%d小时%d分钟",hours,minutes];
} else if (minutes >= 1 && hours < 1) {
result = [NSString stringWithFormat:@"%d分钟",minutes];
} else if (minutes < 1) {
result = [NSString stringWithFormat:@"%d秒",seconds];
}
return result;
}
网友评论