import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;

import java.time.DayOfWeek;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;

/**
 * @author reghao
 * @date 2025-04-18 09:42:48
 */
@Slf4j
public class DateTest {
    Set<Integer> bigMonth = Set.of(1, 3, 5, 7, 8, 10, 12);
    Set<Integer> smallMonth = Set.of(4, 6, 9, 11);
    String[] tianGan = {"甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"};
    String[] diZhi = {"子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"};
    String[] shengXiao = {"鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"};
    String[] jieQi = {"立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑",
            "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至", "小寒", "大寒"};

    @Test
    public void dateTest() {
        LocalDateTime localDateTime = LocalDateTime.now();
        DayOfWeek dayOfWeek = localDateTime.getDayOfWeek();

        int yearValue = localDateTime.getYear();
        int monthValue = localDateTime.getMonth().getValue();
        int monthDayValue = localDateTime.getDayOfMonth();
        int weekDayValue = dayOfWeek.getValue();
        boolean leapYear = yearValue%4 == 0;

        System.out.printf("Mon\tTue\tWed\tThu\tFri\tSat\tMon\n");

        String date = "2003-05-10 15:00:33";
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss").withZone(ZoneId.of("UTC"));
        LocalDateTime localDateTime1 = LocalDateTime.parse(date, formatter);
        Duration duration = Duration.between(localDateTime, localDateTime1);
        System.out.println();
    }
}
