Sun Java System Portal Server Mobile Access 7.1 Tag Library Reference

dateformat

Description

The dateformat tag either formats a datetime for output or parses one from an input. The format attribute specifies the format to use either to format for output or to parse from input. If the parse attribute is specified then that value is used as the parse string to set the specified datetime. If the parse attribute is not specified then the datetime is formatted to the page output.

Tag Body

JSP

Restrictions

The datetime to operate on is located as follows. If the name attribute is specified then that datetime bean is used. Otherwise the parent datetime tag is used.

Attributes

The tag has the following attributes for which the Required values are “Yes” and “No”:

name

Specifies the name of the datetime bean to use. If not specified then the parent datetime tag is used.

format

The java.text.SimpleDateFormat format string to use to format or parse the datetime with.

parse

The string to parse into a datetime using format.

Properties

n/a

Example(s)
<%-- create now datetime and output hours/minutes --%>
<cal:datetime id="now"/>
<cal:dateformat name="now" format="hh:mm"/>

<%-- set datetime from hours/minutes parse string --%>
<cal:datetime>
<cal:dateformat format="hh:mm" parse="10:30"/>
</cal:datetime>