package com.logicbig.example.dayofweek;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.temporal.ChronoField;
public class GetLongFieldExample3 {
public static void main (String[] args) {
LocalDate localDate = LocalDate.parse("2016-10-05");
Long i = DayOfWeek.from(localDate)
.getLong(ChronoField.DAY_OF_MONTH);
System.out.println(i);
}
}
Output
Caused by: java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: DayOfMonth
at java.time.DayOfWeek.getLong(DayOfWeek.java:348)
at com.logicbig.example.dayofweek.GetLongFieldExample3.main(GetLongFieldExample3.java:16)
... 6 more