I\'m aware that you can use DateUtils.formatElapsedTime(seconds) to convert a number of seconds into a String with the format HH:MM:SS
Based on the available information, you seem to be wanting to format a duration based value. Lucky for us, since Java 8, there is now a new java.time API which includes a Duration class.
Unfortunately, it doesn't (at least the last time checked) support a formatter for it.
However, you could easily roll your own...
protected static String format(Duration duration) {
long hours = duration.toHours();
long mins = duration.minusHours(hours).toMinutes();
return String.format("%02d:%02d", hours, mins);
}
Which when used with something like...
System.out.println(format(Duration.ofSeconds(3665)));
prints out 01:01.
Now I know you'd "prefer" utility methods, but you're unlikely to find something that fits your "every" need and this at least gives you a starting point. Besides, you could always make a pull request ;)