gogoWebsite

About LocalDate format data query problem

Updated to 1 day ago
/** * @author lijin * @version 1.0 * @date 2022/10/24 15:26 * * Solve the problem of data passing in the front-end localDate format, and the start time and end time cannot be queried on the same day. */ public class TimeConvertUtils { public static LocalDateTime startTimeConvert(LocalDate localDate){ if (ObjectUtil.isNotEmpty(localDate)){ LocalTime suffix = LocalTime.of(00, 00, 00); return LocalDateTime.of(localDate, suffix); } return null; } public static LocalDateTime endTimeConvert(LocalDate localDate){ if (ObjectUtil.isNotEmpty(localDate)){ LocalTime suffix = LocalTime.of(23, 59, 59); return LocalDateTime.of(localDate, suffix); } return null; } }