TagLib: Calendar

datetime

Description

The datetime tag makes the specified date/time bean properties available.

Tag Body

JSP

Restrictions

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.

Attributes

The tag has the following attributes:

Attribute

Description

Req'd?

id Specifies the id of the bean to create. No
name Specifies the name of the bean to use. No

Properties

The tag provides the following bean properties:

Property

Description

Type

Access

hours Hours of the time; in a 24 hour clock Integer
Get/Set
minutes Minutes of the time. Integer
Get/Set
seconds Seconds of the time. Integer
Get/Set
day Day of the date. ???
Get/Set
month Month of the date. ???
Get/Set
year Year of the date; a 4 digit year. Integer
Get/Set

Example(s)

<%-- 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>