Java Duration Format formatDuration(Duration d)

Here you can find the source of formatDuration(Duration d)

Description

format Duration

License

Open Source License

Declaration

static String formatDuration(Duration d) 

Method Source Code


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

import java.time.Duration;

public class Main {
    static String formatDuration(Duration d) {
        long s = d.getSeconds();
        return String.format("%d:%02d:%02d", s / 3600, (s % 3600) / 60, s % 60);
    }//from  w  ww  .j  a v  a 2  s .c  o  m
}

Related

  1. durationToString(long x)
  2. durationTranslator(String sonarDuration)
  3. format8601Duration(long duration)
  4. formatBuildDuration(final long duration)
  5. formatDuration(double dblSeconds)
  6. formatDuration(Duration duration)
  7. formatDuration(Duration duration)
  8. formatDuration(Duration duration)
  9. formatDuration(Duration duration)