본문 바로가기
반응형

프로그래밍/JAVA, JSP49

자바(JAVA) SimpleDateFormat을 이용한 날짜 계산 //날짜 클래스 생성 Date curDate = new Date(); //날짜형식 변환 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); sdf.format(curDate); //현재날짜 출력 System.out.println("today : " + sdf.format(curDate)); //어제날짜 계산 Date yesterDay = new Date(); yesterDay.setTime(curDate.getTime() - ((long)(1000 * 60 * 60 * 24) * 2)); //어제날짜 출력 System.out.println("yesterDay : " + sdf.format(yesterDay)); 2013. 11. 12.
자바(JAVA) 캘린더 클래스를 이용한 날짜 계산 //날짜 클래스 생성 Date curDate = new Date(); Calendar cal = Calendar.getInstance(); //현재날짜 셋팅 cal.setTime(curDate); //현재년도 출력 System.out.println(cal.get(Calendar.YEAR)); //월 계산 cal.add(Calendar.MONTH, 2); //계산된 월 출력 System.out.println(cal.get(Calendar.MONTH)); //일자 계산 cal.add(Calendar.DAY_OF_MONTH, 5); //일자 출력 System.out.println(cal.get(Calendar.DAY_OF_MONTH)); 2013. 11. 12.
자바스크립트 selectBox value 값 가져오기 1. value값 가져오기 var obj = document.formname.select_name.options[document.formname.select_name.selectedIndex].value; 2. text값 가져오기 var obj = document.formname.select_name.options[document.formname.select_name.selectedIndex].text; 현재 select box 의 value 값 넘기기 3. value값 넘기기 2013. 11. 11.
JSP 테이블 헤더(제목) 부분 고정 상하로 스크롤을 하여도 테이블 헤더(제목) 부분은 고정된다. aaaa bbbb 스크롤할때 디자인이 조금 깨지는 부분이 있지만 아직까지 수정하는 방법은 모르겠다.. 2013. 11. 11.
반응형