Here you can find the source of formatSecondsRegular(int seconds)
public static String formatSecondsRegular(int seconds)
//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*/ }