I am using the below code to convert from duration in seconds
to the format HH:MM:SS
.
String.format("%02d:%02d:%02d", durationSeconds / 3600,
(durationSeconds % 3600) / 60, (durationSeconds % 60));
You can easily adjust this to accept input in minutes
but then your output will be in the format of HH:MM:00
since you do not have seconds, e.g.:
String.format("%02d:%02d:%02d", durationMinutes / 60, durationMinutes % 60, 0);