Period ofDays(int days) example
Description
Period ofDays(int days)
creates a Period representing
a number of days.
Syntax
ofDays
has the following syntax.
public static Period ofDays(int days)
Example
The following example shows how to use ofDays
.
import java.time.Period;
//from w w w. j a v a2s . com
public class Main {
public static void main(String[] args) {
Period p = Period.ofDays(12);
System.out.println(p.toString());
}
}
The code above generates the following result.