public static void main(String[] args) {
String str = "221";
int seconds = Integer.parseInt(str);
int temp=0;
StringBuffer sb=new StringBuffer();
temp = seconds/3600;
sb.append((temp<10)?"0"+temp+":":""+temp+":");
temp=seconds%3600/60;
sb.append((temp<10)?"0"+temp+":":""+temp+":");
temp=seconds%3600%60;
sb.append((temp<10)?"0"+temp:""+temp);
System.out.println(sb.toString());
}
时间: 2024-10-12 21:40:34