Java Second Format formatSecondsRegular(int seconds)

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

Description

format Seconds Regular

License

Open Source License

Declaration

public static String formatSecondsRegular(int seconds) 

Method Source Code

//package com.java2s;

public class Main {
    public static String formatSecondsRegular(int seconds) {
        int sec = seconds % 60;
        int min = seconds / 60 % 60;
        int h = seconds / 3600;
        return ((h != 0) ? h + " h " : "") + ((min != 0) ? min + " min" : sec + " s");
    }/* w  ww  . j a  v  a  2 s  .  co m*/
}

Related

  1. formatSeconds(long seconds)
  2. formatSeconds(long secsIn)
  3. formatSeconds(long time)
  4. formatSeconds(long time)
  5. formatSeconds(long time, String timerPrecisionId, boolean round)
  6. formatSecondsWithHour(int seconds)
  7. formatTime(Date d, Locale locale, boolean withSeconds)
  8. formatTime(double seconds)
  9. formatTime(float seconds)