Computer_IT/JSP

Calendar 를 이용한 날짜 출력

고급코드 2006. 4. 7. 15:23
반응형
  1. <%@ page contentType = "text/html;charset=euc-kr" %>
  2. <%@ page import = "java.util.Calendar" %>
  3. <head><title>Calendar 클래스 사용</title></head>
  4. <% Calendar cal = Calendar.getInstance(); %>
  5. 오늘은
  6. <%=cal.get(Calendar.YEAR) %>
  7. <%=cal.get(Calendar.MONTH)+1 %>
  8. <%=cal.get(Calendar.DATE) %> 일 입니다.
  9. </body>
  10. </html>
 
반응형