how to make new local date time in java code example
Example 1: localdatetime java example
LocalDateTime current=LocalDateTime.now();
LocalDateTime dateTime=LocalDateTime.of(year,month,day,hour,minute,second);
dateTime.getHour();
dateTime.getDayOfWeek();
dateTime.isBefore(someOtherDateTime);
dateTime.toLocalDate();
dateTime.toLocalTime();
Example 2: local date to date java
public LocalDate convertToLocalDateViaInstant(Date dateToConvert) {
return dateToConvert.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDate();
}