package com.ruoyi;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

/**
 * @author zhouwenhao
 * @date 2025/6/11
 * @dec 描述
 */
public class Test {
    public static void main(String[] args) {
        // 获取当前日期
        LocalDateTime today = LocalDateTime.now();
        // 获取当前月的第一天和最后一天
        LocalDateTime firstDayOfMonth = today.withDayOfMonth(1).with(LocalTime.MIN);
        LocalDateTime lastDayOfMonth = today.plusMonths(1).withDayOfMonth(1).with(LocalTime.MIN).minusSeconds(1);
        // 打印结果
        System.out.println("Start of month: " + firstDayOfMonth);
        System.out.println("End of month: " + lastDayOfMonth);
    }
}
