Java Second Convert secondsToTimeClock(int totalSeconds)

Here you can find the source of secondsToTimeClock(int totalSeconds)

Description

seconds To Time Clock

License

Open Source License

Declaration

public static String secondsToTimeClock(int totalSeconds) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String secondsToTimeClock(int totalSeconds) {
        double totalSecondsDouble = (int) totalSeconds;
        int minutes = (int) (Math.floor(totalSecondsDouble / 60));
        int seconds = (int) (totalSecondsDouble % 60);

        return "" + (minutes > 0 ? minutes : "0") + ":"
                + (seconds < 1 ? "00" : (seconds < 10 ? "0" : "") + seconds);
    }/*ww  w.jav a2s . co  m*/
}

Related

  1. secondsToTicks(int seconds)
  2. secondsToTime(double seconds)
  3. secondsToTime(int seconds)
  4. secondsToTime(int seconds)
  5. secondsToTime(long timeseconds)
  6. secondsToTimecode(long seconds)
  7. secondsToTimeDisplay(Object value)
  8. secondsToTimeString(int numSeconds)
  9. secondsToTimeString(long in_seconds)