public class TimeConvertor {
public static void main(String[] args) {
System.out.println("Please write milliseconds ");
//Input for milliseconds
Scanner input = new Scanner(System.in);
//Operations for finding hours minutes seconds
long millis = input.nextLong();
//Method's name
convertMillis(millis);
}
public static void convertMillis(long millis){
//Calculation for the time
long hours = millis / 3600000;
long remaininghours = millis % 3600000;
long minutes = remaininghours / 60000;
long remainingminutes = remaininghours % 60000;
long seconds = remainingminutes / 1000;
System.out.println(hours + ":" + minutes +":"+ seconds);
}
}
Hiç yorum yok:
Yorum Gönder