/**
* 获取本月第一天
* @return String
**/
public static String getMonthStart() {
Calendar cal = ();
(, 0);
(Calendar.DAY_OF_MONTH, 1);
Date time = ();
return new SimpleDateFormat("yyyy-MM-dd").format(time) + " 00:00:00";
}
/**
* 获取本月最后一天
* @return String
**/
public static String getMonthEnd() {
Calendar cal = ();
(Calendar.DAY_OF_MONTH, (Calendar.DAY_OF_MONTH));
Date time = ();
return new SimpleDateFormat("yyyy-MM-dd").format(time) + " 23:59:59";
}
/**
* 获取本周的第一天
* @return String
**/
public static String getWeekStart() {
Calendar cal = ();
(Calendar.WEEK_OF_MONTH, 0);
(Calendar.DAY_OF_WEEK, 2);
Date time = ();
return new SimpleDateFormat("yyyy-MM-dd").format(time) + " 00:00:00";
}
/**
* 获取本周的最后一天
* @return String
**/
public static String getWeekEnd() {
Calendar cal = ();
(Calendar.DAY_OF_WEEK, (Calendar.DAY_OF_WEEK));
(Calendar.DAY_OF_WEEK, 1);
Date time = ();
return new SimpleDateFormat("yyyy-MM-dd").format(time) + " 23:59:59";
}