Android Second to Time convertSecondsToTimeStamp(int seconds)

Here you can find the source of convertSecondsToTimeStamp(int seconds)

Description

convert Seconds To Time Stamp

Declaration

public static String convertSecondsToTimeStamp(int seconds) 

Method Source Code

//package com.java2s;

public class Main {
    public static String convertSecondsToTimeStamp(int seconds) {
        String hours = Integer.toString(seconds / 3600);
        if (hours.length() == 1) {
            hours = '0' + hours;
        }/*from w w  w .ja va 2 s. c o m*/
        String minutes = Integer.toString((seconds % 3600) / 60);
        if (minutes.length() == 1) {
            minutes = '0' + minutes;
        }

        String secondsStr = Integer.toString(seconds % 60);
        if (secondsStr.length() == 1) {
            secondsStr = '0' + secondsStr;
        }
        return hours + ":" + minutes + ":" + secondsStr;
    }
}

Related

  1. secsToText(long time)
  2. calculateDhms(int seconds)
  3. secondsToString(int seconds)
  4. intSecondsToStringMinSec(int input)