Example usage for org.apache.commons.lang.time DurationFormatUtils formatDurationISO

List of usage examples for org.apache.commons.lang.time DurationFormatUtils formatDurationISO

Introduction

In this page you can find the example usage for org.apache.commons.lang.time DurationFormatUtils formatDurationISO.

Prototype

public static String formatDurationISO(long durationMillis) 

Source Link

Document

Formats the time gap as a string.

The format used is the ISO8601 period format.

This method formats durations using the days and lower fields of the ISO format pattern, such as P7D6TH5M4.321S.

Usage

From source file:org.eclipse.skalli.core.rest.JSONRestWriter.java

@Override
public RestWriter duration(long millis) throws IOException {
    return value(DurationFormatUtils.formatDurationISO(millis));
}

From source file:org.eclipse.skalli.core.rest.JSONRestWriter.java

@Override
public RestWriter duration(String key, long millis) throws IOException {
    return object(key).pair(MILLIS_KEY, millis).value(DurationFormatUtils.formatDurationISO(millis));
}