
Date 클래스의 setMinutes() 메서드는 인수로 전달하는 min(분)만 변경합니다. 따라서 setMinutes() 메서드는 분을 설정하는 메서드입니다.
setMinutes() 메서드는 setSeconds() 메서드와 setMilliseconds() 메서드와는 다르게 분만 설정할 수 있습니다.
분, 초, 밀리초를 설정하려면 setSeconds() 메서드와 setMilliseconds() 메서드를 사용해야 합니다.
예를 들어, Date 클래스의 객체를 생성한 후 setMinutes() 메서드를 사용하여 분을 설정할 수 있습니다.
#hostingforum.kr
java
Date date = new Date();
date.setMinutes(30); // 30분을 설정합니다.
2025-08-05 21:21