首先引入
<%@ page import="java.util.Date"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<c:set var="nowDate">
<fmt:formatDate value="<%=new Date()%>" pattern="yyyy-MM-dd " type="date"/>
</c:set>
<c:set var="createDate">
<fmt:formatDate value="${c.createTime}" pattern="yyyy-MM-dd " type="date"/>
</c:set>
<c:if test="${nowDate == createDate }">
显示当天的
</c:if>
还可以参考:
http://my.oschina.net/idiot521/blog/311605