fwq
2022-12-17 05b1758ef5f78b1496e77dd00969f3af754afd46
修改时间工具类
1个文件已修改
8 ■■■■ 已修改文件
src/main/java/com/hx/util/DateUtil.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/hx/util/DateUtil.java
@@ -640,7 +640,7 @@
    public static String dayToStart(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.HOUR, 0);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
@@ -653,7 +653,7 @@
    public static String dayToEnd(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.HOUR, 23);
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA);
@@ -666,7 +666,7 @@
    public static Date dayToEndDate(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.HOUR, 23);
        calendar.set(Calendar.HOUR_OF_DAY, 23);
        calendar.set(Calendar.MINUTE, 59);
        calendar.set(Calendar.SECOND, 59);
        return calendar.getTime();
@@ -722,7 +722,7 @@
    public static boolean getFrontMinute(Date date,int num) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        cal.set(Calendar.HOUR, num-1);
        cal.set(Calendar.HOUR_OF_DAY, num-1);
        cal.set(Calendar.MINUTE, 59);
        cal.set(Calendar.SECOND, 59);