|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class TimeUtil { |
|
|
public class TimeUtil { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* |
|
|
|
|
|
* @param milliseconds 毫秒 |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
public static String getFormatFlyTime(long milliseconds){ |
|
|
public static String getFormatFlyTime(long milliseconds){ |
|
|
|
|
|
|
|
|
long day = TimeUnit.MILLISECONDS.toDays(milliseconds); |
|
|
long day = TimeUnit.MILLISECONDS.toDays(milliseconds); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long seconds = TimeUnit.MILLISECONDS.toSeconds(milliseconds) |
|
|
long seconds = TimeUnit.MILLISECONDS.toSeconds(milliseconds) |
|
|
- TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(milliseconds)); |
|
|
- TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(milliseconds)); |
|
|
System.out.println("milliseconds :-" + milliseconds); |
|
|
|
|
|
|
|
|
System.out.println("milliseconds :" + milliseconds); |
|
|
|
|
|
|
|
|
if(day!=0L){ |
|
|
if(day!=0L){ |
|
|
return String.format("%d 天 %d 时 %d 分 %d 秒", day, hours, minutes, seconds); |
|
|
return String.format("%d 天 %d 时 %d 分 %d 秒", day, hours, minutes, seconds); |