Java/예제

날짜와 시간 퀴즈

move2 2022. 11. 16. 14:21
연도/월/일 시간:분으로 나타내기
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;


public class Main {
    public static void main(String[] args) {
        DateTimeFormatter dateformatter = DateTimeFormatter.ofPattern("yyyy/MM/dd h:mm");
        String myDate = dateformatter.format(LocalDateTime.now());
        

        System.out.println(myDate);

    }

}