예제 #1
0
 public void setDate(int day, int month, int year) {
   LocalDate dateToSet = LocalDate.of(day, month, year);
   LocalTime currentTime = LocalTime.from(dateAndTime);
   dateAndTime = LocalDateTime.of(dateToSet, currentTime);
 }
예제 #2
0
 public void setDateAndTime(int day, int month, int year, int hour, int minute, int second) {
   LocalDate dateToSet = LocalDate.of(day, month, year);
   LocalTime timeToSet = LocalTime.of(hour, minute, second);
   dateAndTime = LocalDateTime.of(dateToSet, timeToSet);
 }
예제 #3
0
 public void setTime(int hour, int minute, int second) {
   LocalDate currentDate = LocalDate.from(dateAndTime);
   LocalTime timeToSet = LocalTime.of(hour, minute, second);
   dateAndTime = LocalDateTime.of(currentDate, timeToSet);
 }