java날짜 (2) 썸네일형 리스트형 [JAVA] Calendar, Date, SimpleDateFormat 날짜 호출 Date 매서드에 SimpleDateFormat 매서드를 이용해 원하는 양식으로 호출 SimpleDateFormat 예제 import java.util.calendar import java.text.*; class DateFormatEx1{ public static void main(String[] args){ Date today = new Date(); SimpleDateFormat sdf1, sdf2, sdf3, sdf4; sdf1 = new SimpleDateFormat("yyyy-MM-dd"); sdf2 = new SimpleDateFormat("yy년 MMM dd일 E요일"); sdf3 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); sdf4 = new.. [JAVA] 현재 날짜/시간 출력 toLocaleString Date() 매서드 하위 toLocaleString() toLocaleString(): 현재날짜와 시간을 출력하는 매서드 import java.util.Date; public class DateTest { public static void main(String[] args) { Date date = new Date(); System.out.println(date.toLocaleString()); } } 이전 1 다음