//캘린더 객체에서 날짜를 가져오고, DB에 입력된 날짜와 비교합니다. 오늘 입력한 글이면 이미지를 보여줍니다.
<%
Calendar calendar=Calendar.getInstance();
int year=calendar.get(Calendar.YEAR);
int month=calendar.get(Calendar.MONTH)+1;
int date=calendar.get(Calendar.DATE);
int year2=Integer.parseInt(writeday[idx].substring(0,4));
int month2=Integer.parseInt(writeday[idx].substring(5,7));
int date2=Integer.parseInt(writeday[idx].substring(8,10));
if(year==year2 && month==month2 && date==date2) {
%>
<img src="/image/new.gif">
<% } else { %>
<% } %>
'개발 > jsp' 카테고리의 다른 글
DB이용한 입출력하기 (0) | 2020.02.05 |
---|---|
답변형 게시판 JSP 관계도 (0) | 2020.02.05 |
jsp페이지에서 query 실행 (0) | 2020.02.05 |
Util.ko (0) | 2020.02.05 |
합이 잘못됐습니다. (0) | 2020.02.05 |