Today taglib ver. 1.3

    Custom JSP taglib lets you calculate various attributes for the current date. Tag creates in the page scope a set of predefined variables for all the attributes of the current date. For example:
 


<%@ taglib uri="taglib.tld" prefix="t" %>

<t:today/>

<p>Date: <%=currentDate%>
<br>Year: <%=currentYear%>
<br>Month: <%=currentMonth%>
<br>Day: <%=currentDay%>
<br>Day of week: <%=currentDayOfWeek%>
<br>Hour: <%=currentHour%>
<br>Minute: <%=currentMinute%>

If you are using JSTL you can use some like this ${currentDate} for example. Predefined names and types are:

NameType
currentDatejava.util.Date
currentYearjava.lang.Integer
currentMonthjava.lang.Integer
currentDayjava.lang.Integer
currentDayOfWeekjava.lang.Integer
currentHourjava.lang.Integer
currentMinutejava.lang.Integer

Tags are:

today

Tag calculates all the attributes for the current date. Parameters are: none

ifWeekEnd

Body tag executes own body if today is Sunday or Saturday. Parameters are: none

ifNotWeekEnd

Body tag executes own body if today is not Sunday or Saturday. Parameters are: none

for downloading:

Library: todaytag.jar    Description: taglib.tld

© Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: