Duration from(TemporalAmount amount)
gets an instance of Duration from
a temporal amount.
from
has the following syntax.
public static Duration from(TemporalAmount amount)
The following example shows how to use from
.
import java.time.Duration; 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.