Java Second Format secondsToStringFormat(long seconds)

Here you can find the source of secondsToStringFormat(long seconds)

Description

seconds To String Format

License

Apache License

Declaration

public static String secondsToStringFormat(long seconds) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String secondsToStringFormat(long seconds) {
        long aux = seconds;
        int sec = (int) aux % 60;
        aux = aux / 60;//from  w  ww.j a  va2  s.co  m
        int min = (int) aux % 60;
        aux = aux / 60;
        String res;
        if (sec < 10)
            res = ":0" + sec;
        else
            res = ":" + sec;
        if (min < 10)
            res = ":0" + min + res;
        else
            res = ":" + min + res;
        return aux + res;
    }
}

Related

  1. secondsBetween(String from, String to, String format)
  2. secondsToDHMSString(double seconds)
  3. secondstoHM(long sec)
  4. secondsToHumanDate(long seconds)
  5. secondsToString(long seconds)
  6. secondsToTime(double seconds)
  7. secondsToTimeString(long numSeconds)
  8. toSecondString(long time)