tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: using <c:if> tag to work out if one date is less than another.
Date Thu, 04 Sep 2003 12:31:25 GMT
<jsp:useBean id="now" class="java.util.Date"/>
...
<c:choose>
  <c:when test="${fixture.kickoffDate.time lt now.time}">
    ...
  </c:when>
  <c:otherwise>
    ...
  </c:otherwise>
</c:choose>
...

Quoting Martin Smith <martin.smith@goldenhill.co.uk>:

> Hi,
> 
> I'm trying to use the <c:if> tag to determine if one date is before or
> after
> another.  My code is at the bottom of this email.
> 
> fixture.kickoffDate returns a java.util.Date object.  Can I use .time to
> get
> me a long?
> 
> I realise that I can't put the System.currentTimeMillis code in, but how
> can
> I get the
> current system time in to a scripting variable??
> 
> 
> <table>
> 	<tr>
> 	<c:if test="${fixture.kickoffDate.time < System.currentTimeMillis}" >
> 		<td> Kick off is less than system time </td>
> 	</c:if>
> 	<c:if test="${fixture.kickoffDate.time > System.currentTimeMillis}" >
> 		<td> Kick off is greater than system time </td>
> 	</c:if>
> 	</tr>
> </table>
> 
> Using Tomcat 4.1.18 and JSTL 1.0

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

Mime
View raw message