From 6c39053bdf64ac130daee2bf3b44ce1c025b4dbd Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 4 Jul 2021 21:23:50 -0600 Subject: fixed time formatting --- src/net/brysonsteck/Resurrection/player/TimeCheck.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/net/brysonsteck/Resurrection/player/TimeCheck.java') diff --git a/src/net/brysonsteck/Resurrection/player/TimeCheck.java b/src/net/brysonsteck/Resurrection/player/TimeCheck.java index f1cf004..dc989ea 100644 --- a/src/net/brysonsteck/Resurrection/player/TimeCheck.java +++ b/src/net/brysonsteck/Resurrection/player/TimeCheck.java @@ -10,9 +10,11 @@ public class TimeCheck { } public String formatTime() { + long hours = TimeUnit.MILLISECONDS.toHours(millis); + String formattedTime = String.format("%d hrs, %d min, %d sec", TimeUnit.MILLISECONDS.toHours(millis), - TimeUnit.MILLISECONDS.toMinutes(millis), + TimeUnit.MILLISECONDS.toMinutes(millis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millis)), TimeUnit.MILLISECONDS.toSeconds(millis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))); return formattedTime; -- cgit v1.2.3