Java 将秒转化为xx分xx秒
代码
private static String getMinutes(int seconds){
if(seconds>0){
int remainder = seconds % 60;
int minutes = (seconds - remainder) / 60;
String minute = String.valueOf(minutes).length()<2 ? "0"+minutes : String.valueOf(minutes);
String second = String.valueOf(remainder).length()<2 ? "0"+remainder : String.valueOf(remainder);
return minute+":"+second;
}
return "00:00";
}