jsp 判断时间大小
jsp 判断时间大小
<% SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date dstart = sdf.parse("2017-11-01 0:00:00"); Date dend = sdf.parse("2017-11-09 0:00:00"); Date dcur = sdf.parse((String)request.getAttribute("currentTime")); request.setAttribute("dstart",dstart); request.setAttribute("dend",dend); request.setAttribute("dcur",dcur); %> <c:choose> <c:when test="${(dcur.getTime()-dstart.getTime() > 0)&&(dcur.getTime()-dend.getTime() < 0)}"> <li class="jsBtn" style="background-color: #908e8e;"><a href="javascript:;" style="font-size:12px">惺惺惜惺惺想寻</a></li> </c:when> <c:otherwise> <li class="jsBtn"><a href="javascript:aclick();">啦啦啦啦</a></li> </c:otherwise> </c:choose>