package com.yuchen.saas.parking.api.util;

import java.util.Calendar;
import java.util.Date;

/**
 * 时间处理方法
 */
public class ParkDateUtils {
    /**
     * 获取当月第一天(00:00:00)
     * @return
     */
    public static Date getThisMonthFirstDay() {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        //将小时至0
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        //将分钟至0
        calendar.set(Calendar.MINUTE, 0);
        //将秒至0
        calendar.set(Calendar.SECOND, 0);
        //将毫秒至0
        calendar.set(Calendar.MILLISECOND, 0);
        //获得当前月第一天
        Date startDate = calendar.getTime();

        return startDate;
    }
}
