display java time Duration as String - Java Date Time

Java examples for Date Time:Duration

Description

display java time Duration as String

Demo Code


//package com.java2s;

import java.time.Duration;

public class Main {
    public static String displayDuration(Duration tempsCourse) {
        return String.valueOf(tempsCourse.toHours() + "h")
                + String.valueOf(tempsCourse.toMinutes() % 60);
    }//from  www .j av a 2 s .  c o  m
}

Related Tutorials