You can use the java date and time api. Brief example (using the method signature you provided at question body) :
static DateFormat dateFormat = new SimpleDateFormat("dd/MM/yy"); //specifiy the
//representation pattern. This is for example. You can construct it more accurate:
//display the hours, mins, secs, etc. Also you can specify your own delimiters.
//See more at docs below
static { //upd: set the proper timezone
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
}
private static String getHumanizedTime(int seconds) {
long timeInMillis = seconds * 1000; //Date object is designed for millis
Date date = new Date(timeInMillis);
return dateFormat.format(date);
}
Read more at javadocs : http://docs.oracle.com/javase/6/docs/api/java/util/Date.html http://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html
Update : if you want the output to be something like "11 hours, 15 minutes and 34 seconds", try that :
static DateFormat dateFormat = new SimpleDateFormat("HH 'hours,' mm 'minutes and' ss 'seconds'");