반응형 시분초1 [JAVA] 현재 날짜 및 시간 가져오기 자바에서 현재 날짜 및 시간 가져오기 1. 년월일 한글로 가져오기 LocalDateTime nowTime = LocalDateTime.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy년 M월 d일"); System.out.println(nowTime.format(formatter)); → 출력 : 2023년 1월 1일 2. 점 (.) 으로 구분하여 가져오기 LocalDateTime nowTime = LocalDateTime.now(); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd"); System.out.println(nowTime.format(fo.. 2023. 3. 17. 이전 1 다음 반응형