Duration from(TemporalAmount amount) example
Description
Duration from(TemporalAmount amount)
gets an instance of Duration from
a temporal amount.
Syntax
from
has the following syntax.
public static Duration from(TemporalAmount amount)
Example
The following example shows how to use from
.
import java.time.Duration;
/*from ww w . j a v a 2s. co m*/
public class Main {
public static void main(String[] args) {
Duration duration = Duration.from(Duration.ZERO);
System.out.println(duration);
}
}
The code above generates the following result.