Period from(TemporalAmount amount)
creates an instance of Period from a temporal amount.
from
has the following syntax.
public static Period from(TemporalAmount amount)
The following example shows how to use from
.
import java.time.Period; /*www . ja v a 2 s . com*/ public class Main { public static void main(String[] args) { Period p = Period.from(Period.ofMonths(12)); System.out.println(p.toString()); } }
The code above generates the following result.