提供一个将毫秒字段转换成时分的方法。
+ (
NSString *)ConvertStrToTime:(
NSString *)timeStr
{
long long time=[timeStr longLongValue];
NSDate *d = [[
NSDate alloc]initWithTimeIntervalSince1970:time/
1000.0];
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
[formatter setDateFormat:@
"mm:ss"];
NSString*timeString=[formatter stringFromDate:d];
return timeString;
}
转载请注明原文地址: https://ju.6miu.com/read-1000183.html