hey
I'm trying to write a method that converts milliseconds to hours, minutes, and seconds using the following header:
public static String convertMillis(long millis)
My method needs to return a string as hours:minutes:seconds.
For example, convertMillis(5500) returns a string 0:0:5.
this is what i have so far, can someone please help me.
import java.util.*;
class Millis
{
public static void main(String[] args)
{
}
public static String convertMillis(long millis) {
double hours;
double minutes;
double seconds;
int milliseconds = 0;
int currentSeconds = 0;
int totalSeconds = 0;
int totalMinutes = 0;
int totalHours = 0;
System.out.print("convertMillis:");
milliseconds = input.nextInt();
seconds = milliseconds/1000;
hours = seconds/(60*60);
minutes = seconds % ((60*60));
System.out.println("your conversion equals" hours + ":" + minutes + ":" + seconds);
return null;
}