pk 倒计时去掉小时
This commit is contained in:
@@ -120,6 +120,33 @@ public class StringUtil {
|
||||
return sStringBuilder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 把一个long类型的总毫秒数转成时长
|
||||
*/
|
||||
public static String getDurationText2(long mms) {
|
||||
int minutes = (int) ((mms % (1000 * 60 * 60)) / (1000 * 60));
|
||||
int seconds = (int) ((mms % (1000 * 60)) / 1000);
|
||||
sStringBuilder.delete(0, sStringBuilder.length());
|
||||
if (minutes > 0) {
|
||||
if (minutes < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(minutes));
|
||||
sStringBuilder.append(":");
|
||||
} else {
|
||||
sStringBuilder.append("00:");
|
||||
}
|
||||
if (seconds > 0) {
|
||||
if (seconds < 10) {
|
||||
sStringBuilder.append("0");
|
||||
}
|
||||
sStringBuilder.append(String.valueOf(seconds));
|
||||
} else {
|
||||
sStringBuilder.append("00");
|
||||
}
|
||||
return sStringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置视频输出路径
|
||||
|
||||
Reference in New Issue
Block a user