aboutsummaryrefslogtreecommitdiff
path: root/src/net/brysonsteck/Resurrection/TImeCheck.java
blob: a7ea06c69bfb435f8505e50485940b9a2db32d73 (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;

import java.util.concurrent.TimeUnit;

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;
    }
}