LocalDate转换String类型日期,日、周、月、年
/**
* 获取今天开始时间
* return 'yyyy-MM-dd hh:mm:ss'
*/
public static String getTodayStartTime(){
LocalDate localDate = LocalDate.now();
return localDate + " 00:00:00";
}
/**
* 获取今天结束时间
* return 'yyyy-MM-dd hh:mm:ss'
*/
public static String getTodayEndTime(){
LocalDate localDate = LocalDate.now();
return localDate + " 23:59:59";
}
/**
* 获取本周开始时间
* return 'yyyy-MM-dd hh:mm:ss'
*/
public static String getThisWeekStartTime(){
LocalDate localDate = LocalDate.now();
return localDate.minusDays(localDate.getDayOfWeek().getValue() -1) + " 00:00:00";
}
/**
* 获取本周结束时间
* return 'yyyy-MM-dd hh:mm:ss'
*/
public static String getThisWeekEndTime(){
LocalDate localDate = LocalDate.now();
return localDate.minusDays(localDate.getDayOfWeek().getValue() -7) + " 23:59:59";
}
/**
*