aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/player/TimeCheck.java
blob: f1cf004d12c1fbe50206f82c222af84e905fad79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package net.brysonsteck.Resurrection.player;

import java.util.concurrent.TimeUnit;

public class TimeCheck {
    long millis;

    public TimeCheck(long millis) {
        this.millis = millis;
    }

    public String formatTime() {
        String formattedTime = String.format("%d hrs, %d min, %d sec",
                TimeUnit.MILLISECONDS.toHours(millis),
                TimeUnit.MILLISECONDS.toMinutes(millis),
                TimeUnit.MILLISECONDS.toSeconds(millis) -
                        TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis)));
        return formattedTime;
    }
}