import java.util.Scanner;
public class Millls {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter milliseconds: ");
long millis= sc.nextLong();
System.out.println(convertMillis(millis));
}
public static String convertMillis(long millis){
long s = (millis / 1000) % 60;
long m = (millis / (1000 * 60)) % 60;
long hh = (millis / (1000 * 60 * 60)) % 24;
String time = String.format("%d:%d:%d",hh,m,s);
return time;
}
}
I need to specifically do convert mills (555550000) to return a string 154:19:10. Please it is different than the other questions. I had try %02: but it still doesn't work