LocalDate get(TemporalField field) example
Description
LocalDate get(TemporalField field)
gets the value of the
specified field from this date as an int.
Syntax
get
has the following syntax.
public int get(TemporalField field)
Example
The following example shows how to use get
.
import java.time.LocalDate;
import java.time.temporal.ChronoField;
/*from ww w.jav a2 s. co m*/
public class Main {
public static void main(String[] args) {
LocalDate a = LocalDate.of(2014, 6, 30);
System.out.println(a.get(ChronoField.DAY_OF_YEAR));
}
}
The code above generates the following result.