package com.akaiqi.chun.time;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoField;
import java.time.temporal.Temporal;
import static java.time.temporal.ChronoField.DAY_OF_MONTH;
import static java.time.temporal.ChronoUnit.DAYS;
public class LocalDateTest {
private static void test1() {
LocalDate date = LocalDate.of(2019, 11, 1);
System.out.println(date);
int year = date.getYear();
Month month = date.getMonth();
System.out.println(month);
System.out.println(month.getValue());
int day = date.getDayOfMonth();
System.out.println(day);
DayOfWeek dayOfWeek = date.getDayOfWeek();
System.out.println(dayOfWeek);
int len = date.lengthOfMonth();
System.out.println(len);
boolean leap = date.isLeapYear();
System.out.println(leap);
}
private static void test2() {
LocalDate today = LocalDate.now();
System.out.println(today);
int year = today.get(ChronoField.YEAR);
int month = today.get