Java Second second2time(int seconds)

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

Description

secondtime

License

Apache License

Declaration

public static String second2time(int seconds) 

Method Source Code

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

public class Main {

    public static String second2time(int seconds) {
        int hour = seconds / 3600;
        int other = seconds % 3600;
        int minute = other / 60;
        int second = other % 60;
        StringBuilder sb = new StringBuilder();
        if (hour < 10) {
            sb.append("0");
        }/*www  .  j a v  a 2 s.  c o m*/
        sb.append(hour);
        sb.append(":");
        if (minute < 10) {
            sb.append("0");
        }
        sb.append(minute);
        sb.append(":");
        if (second < 10) {
            sb.append("0");
        }
        sb.append(second);
        return sb.toString();
    }
}

Related

  1. currentSecondsPlus(final long seconds)
  2. dateArrayFromSeconds(int inSeconds)
  3. dateDiffToSeconds(final String diff)
  4. HoursToSeconds(final float hours)
  5. isSecondsWholeHour(long secs)
  6. seconds(int num)
  7. seconds(int s)
  8. seconds(int seconds)
  9. secondsAfterMidnightToClock(int secondsAfterMidnight)