secToTime1 [Java] 초단위 -> 문자열 시분초로 변환(secToTime) 구현 public static String secToTime(int time) { int hours = (int) Math.floor(times / 3600); int minutes = (int) Math.floor((times - (hours * 3600)) / 60); int seconds = (int) Math.floor((times - (hours * 3600) - (minutes * 60))); String hoursStr = String.valueOf(hours); String minutesStr = String.valueOf(minutes); String secondsStr = String.valueOf(seconds); if (hours < 10) {hoursStr = "0" + hours;} .. 2021. 10. 15. 이전 1 다음