验证中...
Languages: Java
Categories: 常用工具包
Latest update 2019-02-12 17:06
毫秒转化为00:00 格式
Raw Copy
public String formatTime(long millisecond) {
int minute;//分钟
int second;//秒数
minute = (int) ((millisecond / 1000) / 60);
second = (int) ((millisecond / 1000) % 60);
if (minute < 10) {
if (second < 10) {
return "0" + minute + ":" + "0" + second;
} else {
return "0" + minute + ":" + second;
}
}else {
if (second < 10) {
return minute + ":" + "0" + second;
} else {
return minute + ":" + second;
}
}
}

Comment list( 0 )

You need to Sign in for post a comment

Help Search