Java Duration Format duration(int len)

Here you can find the source of duration(int len)

Description

duration

License

Open Source License

Declaration

public static String duration(int len) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String duration(int len) {
        final int hours = len / 3600;
        final int minutes = len / 60 % 60;
        final int seconds = len % 60;
        return String.format("%02d:%02d:%02d", hours, minutes, seconds);
    }//from w  ww  .j av  a  2s . c  om
}

Related

  1. durationAsString(long duration)
  2. durationString(long duration)
  3. durationToFormattedString(final Duration duration)
  4. durationToSec(int millis)