1、相关日期处理
public class DateUtil {
public static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
public static SimpleDateFormat sdf3=new SimpleDateFormat("yyyy-MM-dd HH:mm");
private static DecimalFormat decimalFormat=new DecimalFormat("#####0.## S");
public static Date getEndDate(Date current) {
Calendar c = Calendar.getInstance();
c.setTime(current);
c.set(Calendar.HOUR_OF_DAY, 23);
c.set(Calendar.MINUTE, 59);
c.set(Calendar.SECOND, 59);
return c.getTime();
}
public static Date getStartDate(Date current){
Calendar calendarStart = Calendar.getInstance();
calendarStart.setTime(current);
calendarStart.set(calendarStart.get(Calendar.YEAR),
calendarStart.get(Calendar.MONTH),
calendarStart.get(Calendar.DATE),
0, 0, 0);
current = calendarStart.getTime();
return current;
}
public static Date getFirstDay() {
Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH, 1);
return