I want to get the JVM start time and uptime. So far I have done this:
public long getjvmstarttime(){
final long uptime = ManagementFactory.getRuntimeMXBean().getStartTime();
return uptime;
}
public long getjvmuptime(){
final long uptime = ManagementFactory.getRuntimeMXBean().getUptime();
return uptime;
}
But I get the time in milliseconds. How I can convert the time in days and hours. I want to display the milliseconds in this format: 3 days, 8 hours, 32 minutes. Is there amy internal Java method that can convert the milliseconds?