把秒数转换为%d:%02d:%02d 格式
private String stringForTime(int timeSec) { int totalSeconds = timeSec; int seconds = totalSeconds % 60; int minutes = totalSeconds / 60 % 60; int hours = totalSeconds / 3600; if (null!=mFormatBuilder){ this.mFormatBuilder.setLength(0); } return hours > 0 ? this.mFormatter.format("%d:%02d:%02d", new Object[]{Integer.valueOf(hours), Integer.valueOf(minutes), Integer.valueOf(seconds)}).toString() : this.mFormatter.format("%02d:%02d", new Object[]{Integer.valueOf(minutes), Integer.valueOf(seconds)}).toString();}
时间: 2024-10-25 17:14:11