[Java] 현재 날짜, 시간 불러오기
·
🔻Language/Java
import java.time.*; -> 먼저 날짜와 시간에 관련된 함수 import하기 //LocalDate: 날짜 LocalDate nowDate = LocalDate.now(); System.out.println(nowDate); //2023-01-03 System.out.println(nowDate.getYear()); //2023 System.out.println(nowDate.getMonth()); //JANUARY //LocalTime: 시간 LocalTime nowTime = LocalTime.now(); System.out.println(nowTime); //22:22:17.235381 //LocalDateTime: 날짜와 시간 LocalDateTime nowtDateTime = Loca..