The datetime tag makes the specified date/time bean properties available.
JSP
Only one of the id or name attributes should be used at a time. The datetime properties are only valid from the start tag to the end tag.
The tag has the following attributes for which the Required value is “No”:
Specifies the id of the bean to create.
Specifies the name of the bean to use.
The tag provides the following bean properties for which the Type value is “Integer” and Access value is “Get/Set”:
Hours of the time; in a 24 hour clock
Minutes of the time.
Seconds of the time.
Day of the date.
Month of the date.
Year of the date; a 4 digit year.
<%-- create a 'now' datetime at the current time --%> <cal:datetime id="now"/> <%-- create a 'start' datetime with today at 10:30 --%> <cal:datetime id="start"> <cal:set property="hours" value="10"/> <cal:set property="minutes" value="30"/> </cal:datetime> <%-- use a previously created datetime --%> <cal:datetime name="now"> Day = <cal:get property="day"/> Month = <cal:get property="month"/> Year = <cal:get property="year"/> </cal:datetime>