현재시간 구하기 1. 현재 시간 구하기 // format 객체로 원하는 형태로 형식 정의 SimpleDateFormat format1 = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss"); // date 객체 또는 Calendar 객체 사용 가능. Date dt = new Date(); // Calendar c = Calendar.getInstance(); String dt = format1.format(dt); System.out.println(time1); 2. 년/월/일 따로 구해서 가지고 놀기 Calendar cal = Calendar.getInstance(); // 년 int y = cal.get(Calendar.YEAR); // 월 int m = cal.get(Calendar... 이전 1 다음