Java Second Get getTimeStringFromSeconds(int totalSeconds)

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

Description

get Time String From Seconds

License

Open Source License

Declaration

public static String getTimeStringFromSeconds(int totalSeconds) 

Method Source Code

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

public class Main {
    public static String getTimeStringFromSeconds(int totalSeconds) {
        int minutes = totalSeconds / 60;
        int seconds = totalSeconds % 60;
        String minutesString = "" + minutes;
        String secondsString = "" + seconds;
        if (seconds < 10) {
            secondsString = "0" + secondsString;
        }/*from w  w  w.  j a  va  2s .com*/
        return minutesString + ":" + secondsString;
    }
}

Related

  1. getTimeAsSeconds(String value)
  2. GetTimeFromSeconds(double time)
  3. getTimeFromSeconds(int seconds)
  4. getTimeInSecondResolution(long timeMillis)
  5. getTimeSeconds(String time)
  6. getTokenRenewIntervalInSeconds(int tokenValidityInSeconds)
  7. getUnitLengthSeconds(String unit)
  8. getUnixTimeSeconds()
  9. getUSeconds(int time)