Commit 5a855d59 authored by yanzg's avatar yanzg

不记录系统日志

parent 9df52bc3
...@@ -246,6 +246,7 @@ public class DateHelper { ...@@ -246,6 +246,7 @@ public class DateHelper {
//当前起始日期 //当前起始日期
Calendar begin = Calendar.getInstance(); Calendar begin = Calendar.getInstance();
begin.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), 0, 0, 0); begin.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
begin.set(Calendar.MILLISECOND, 0);
return begin; return begin;
} }
...@@ -256,6 +257,13 @@ public class DateHelper { ...@@ -256,6 +257,13 @@ public class DateHelper {
cal.set(Calendar.MILLISECOND, 999); cal.set(Calendar.MILLISECOND, 999);
} }
private static void setDayStart(Calendar cal) {
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
}
/** /**
* 获取某一天起始和结束时间 * 获取某一天起始和结束时间
...@@ -290,6 +298,7 @@ public class DateHelper { ...@@ -290,6 +298,7 @@ public class DateHelper {
public static Date getMonthStart(Date date) { public static Date getMonthStart(Date date) {
Calendar cal = getDayCalendarBegin(date); Calendar cal = getDayCalendarBegin(date);
cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.DAY_OF_MONTH, 1);
setDayStart(cal);
return cal.getTime(); return cal.getTime();
} }
...@@ -318,6 +327,7 @@ public class DateHelper { ...@@ -318,6 +327,7 @@ public class DateHelper {
int month = cal.get(Calendar.MONTH) / 3 * 3; int month = cal.get(Calendar.MONTH) / 3 * 3;
cal.set(Calendar.MONTH, month); cal.set(Calendar.MONTH, month);
cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.DAY_OF_MONTH, 1);
setDayStart(cal);
return cal.getTime(); return cal.getTime();
} }
...@@ -346,6 +356,7 @@ public class DateHelper { ...@@ -346,6 +356,7 @@ public class DateHelper {
Calendar cal = getDayCalendarBegin(date); Calendar cal = getDayCalendarBegin(date);
cal.set(Calendar.MONTH, 0); cal.set(Calendar.MONTH, 0);
cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.DAY_OF_MONTH, 1);
setDayStart(cal);
return cal.getTime(); return cal.getTime();
} }
...@@ -359,6 +370,7 @@ public class DateHelper { ...@@ -359,6 +370,7 @@ public class DateHelper {
Calendar cal = getDayCalendarBegin(date); Calendar cal = getDayCalendarBegin(date);
cal.set(Calendar.MONTH, 11); cal.set(Calendar.MONTH, 11);
cal.set(Calendar.DAY_OF_MONTH, 31); cal.set(Calendar.DAY_OF_MONTH, 31);
setDayEnd(cal);
return cal.getTime(); return cal.getTime();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment