// Path: src/main/java/com/dawn/bgSys/exception/OperateFailureException.java
// public class OperateFailureException extends GenericException {
// 
//     public OperateFailureException(String msg) {
//         super(msg);
//     }
// 
//     public OperateFailureException(String msg, String errorCode) {
//         super(msg, errorCode);
//     }
// 
// }


import com.dawn.bgSys.exception.OperateFailureException;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
        Calendar calendar = Calendar.getInstance();
        Date currentTime = new Date();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH) + 1;
        int quater = (month + 2) / 3;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(getFirstDateOfQuarter(year, quater));
    }

    /**
     * 获得日期，在给定的日期上增加day（如果减去则day为负数）
     * @param date 给定日期
     * @param day 改变天数
     * @return 计算后的日期
     */
    public static Date getDay(Date date, int day) {
        long currDateMills = date.getTime();
        long extraMills = day * 3600 * 1000 * 24;
        Calendar result = Calendar.getInstance();
        result.setTimeInMillis(currDateMills + extraMills);
        return result.getTime();
    }

    /**
     * 获取本地对应时间
     * @return
     */
    public static Date getLocalTime() {
        int diffTime = getDiffTimeZoneRawOffset("Asia/Shanghai");
        long nowTime = System.currentTimeMillis();
// Path: src/main/java/com/dawn/bgSys/exception/OperateFailureException.java
// public class OperateFailureException extends GenericException {
// 
//     public OperateFailureException(String msg) {
//         super(msg);
//     }
// 
//     public OperateFailureException(String msg, String errorCode) {
//         super(msg, errorCode);
//     }
// 
// }


// Path: src/main/java/com/dawn/bgSys/common/TimeUtils.java
import com.dawn.bgSys.exception.OperateFailureException;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

        Calendar calendar = Calendar.getInstance();
        Date currentTime = new Date();
        int year = calendar.get(Calendar.YEAR);
        int month = calendar.get(Calendar.MONTH) + 1;
        int quater = (month + 2) / 3;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        return formatter.format(getFirstDateOfQuarter(year, quater));
    }

    /**
     * 获得日期，在给定的日期上增加day（如果减去则day为负数）
     * @param date 给定日期
     * @param day 改变天数
     * @return 计算后的日期
     */
    public static Date getDay(Date date, int day) {
        long currDateMills = date.getTime();
        long extraMills = day * 3600 * 1000 * 24;
        Calendar result = Calendar.getInstance();
        result.setTimeInMillis(currDateMills + extraMills);
        return result.getTime();
    }

    /**
     * 获取本地对应时间
     * @return
     */
    public static Date getLocalTime() {
        int diffTime = getDiffTimeZoneRawOffset("Asia/Shanghai");
        long nowTime = System.currentTimeMillis();
        long newNowTime = nowTime - diffTime;