blob: 3a4dbebfe14da9c11a76152662c70963d22f2960 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_14) on Mon Apr 26 10:16:13 PDT 2010 -->
<TITLE>
DateTool (VelocityTools 2.0 Documentation)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.velocity.tools.generic.DateTool class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="DateTool (VelocityTools 2.0 Documentation)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/ConversionTool.html" title="class in org.apache.velocity.tools.generic"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/DisplayTool.html" title="class in org.apache.velocity.tools.generic"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/velocity/tools/generic/DateTool.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DateTool.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.velocity.tools.generic</FONT>
<BR>
Class DateTool</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.LocaleConfig</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.FormatConfig</A>
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.velocity.tools.generic.DateTool</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/velocity/tools/generic/ComparisonDateTool.html" title="class in org.apache.velocity.tools.generic">ComparisonDateTool</A></DD>
</DL>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</A>(<A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value()">value</A>="date")
</FONT>public class <B>DateTool</B><DT>extends <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</A></DL>
</PRE>
<P>
Tool for working with <CODE>Date</CODE> and <CODE>Calendar</CODE>
in Velocity templates. It is useful for accessing and
formatting the "current" date as well as for formatting
arbitrary <CODE>Date</CODE> and <CODE>Calendar</CODE> objects. Also
the tool can be used to retrieve <CODE>DateFormat</CODE> instances
or make conversions to and from various date types.
<p><pre>
Example of formatting the "current" date:
$date -> Oct 19, 2003 9:54:50 PM
$date.long -> October 19, 2003 9:54:50 PM PDT
$date.medium_time -> 9:54:50 PM
$date.full_date -> Sunday, October 19, 2003
$date.get('default','short') -> Oct 19, 2003 9:54 PM
$date.get('yyyy-M-d H:m:s') -> 2003-10-19 21:54:50
Example of formatting an arbitrary date:
$myDate -> Tue Oct 07 03:14:50 PDT 2003
$date.format('medium',$myDate) -> Oct 7, 2003 3:14:50 AM
Example tools.xml config (if you want to use this with VelocityView):
&lt;tools&gt;
&lt;toolbox scope="application"&gt;
&lt;tool class="org.apache.velocity.tools.generic.DateTool"
format="yyyy-MM-dd"/&gt;
&lt;/toolbox&gt;
&lt;/tools&gt;
</pre></p>
<p>The methods of this tool are highly interconnected, and overriding
key methods provides an easy way to create subclasses that use
a non-default format, calendar, locale, or timezone.</p>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.0</DD>
<DT><B>Version:</B></DT>
<DD>$Revision: 719489 $ $Date: 2008-11-20 22:05:11 -0800 (Thu, 20 Nov 2008) $</DD>
<DT><B>Author:</B></DT>
<DD>Nathan Bubna</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#DEFAULT_FORMAT_KEY">DEFAULT_FORMAT_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#DEFAULT_LOCALE_KEY">DEFAULT_LOCALE_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.util.TimeZone</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#timezone">timezone</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#TIMEZONE_KEY">TIMEZONE_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The key used for specifying a default timezone via tool configuration.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.velocity.tools.generic.FormatConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#DEFAULT_FORMAT">DEFAULT_FORMAT</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#FORMAT_KEY">FORMAT_KEY</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.velocity.tools.generic.LocaleConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html" title="class in org.apache.velocity.tools.generic">LocaleConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#DEFAULT_LOCALE">DEFAULT_LOCALE</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.velocity.tools.generic.SafeConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOCK_CONFIG_KEY">LOCK_CONFIG_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#OLD_LOCK_CONFIG_KEY">OLD_LOCK_CONFIG_KEY</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#DateTool()">DateTool</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#configure(org.apache.velocity.tools.generic.ValueParser)">configure</A></B>(<A HREF="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</A>&nbsp;values)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does the actual configuration.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.Object)">format</A></B>(java.lang.Object&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts the specified object to a date and formats it according to
the pattern or style returned by <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat()"><CODE>FormatConfig.getFormat()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object)">format</A></B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts the specified object to a date and returns
a formatted string representing that date in the locale
returned by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale)">format</A></B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts the specified object to a date and returns
a formatted string representing that date in the specified
<CODE>Locale</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)">format</A></B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a formatted string representing the specified date,
<CODE>Locale</CODE>, and <CODE>TimeZone</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object)">format</A></B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.lang.Object&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the specified date as a string formatted according to the
specified date and/or time styles.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale)">format</A></B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the specified date as a string formatted according to the
specified <CODE>Locale</CODE> and date and/or time styles.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)">format</A></B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the specified date as a string formatted according to the
specified <CODE>Locale</CODE> and date and/or time styles.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#get(java.lang.String)">get</A></B>(java.lang.String&nbsp;format)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a formatted string representing the date returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#get(java.lang.String, java.lang.String)">get</A></B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a formatted string representing the date and/or time given by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A> in standard, localized patterns.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Calendar</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()">getCalendar</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>Calendar</CODE> instance created using the timezone and
locale returned by getTimeZone() and getLocale().</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()">getDate</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>Date</CODE> derived from the result of <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.text.DateFormat</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat(int, int, java.util.Locale, java.util.TimeZone)">getDateFormat</A></B>(int&nbsp;dateStyle,
int&nbsp;timeStyle,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.text.DateFormat</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat(java.lang.String, java.util.Locale, java.util.TimeZone)">getDateFormat</A></B>(java.lang.String&nbsp;format,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>DateFormat</CODE> instance for the specified
format, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.text.DateFormat</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat(java.lang.String, java.lang.String, java.util.Locale, java.util.TimeZone)">getDateFormat</A></B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <CODE>DateFormat</CODE> instance for the specified
date style, time style, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDay()">getDay</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the day (of the month) value of the date
returned by <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDay(java.lang.Object)">getDay</A></B>(java.lang.Object&nbsp;date)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the day (of the month) value for the specified date.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getMonth()">getMonth</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the month value of the date returned by <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getMonth(java.lang.Object)">getMonth</A></B>(java.lang.Object&nbsp;date)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the month value of the specified date.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getStyleAsInt(java.lang.String)">getStyleAsInt</A></B>(java.lang.String&nbsp;style)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.util.Calendar</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getSystemCalendar()">getSystemCalendar</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getSystemDate()">getSystemDate</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getSystemTime()">getSystemTime</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.TimeZone</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone()">getTimeZone</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the configured <CODE>TimeZone</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getValue(int, java.lang.Object)">getValue</A></B>(int&nbsp;field,
java.lang.Object&nbsp;date)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the specified value of the specified date,
or null if the field or date is invalid.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getValue(java.lang.Object)">getValue</A></B>(java.lang.Object&nbsp;field)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the specified value of the date returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A> or null if the field is invalid.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getValue(java.lang.Object, java.lang.Object)">getValue</A></B>(java.lang.Object&nbsp;field,
java.lang.Object&nbsp;date)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the specified value of the specified date,
or null if the field or date is invalid.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getYear()">getYear</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the year value of the date returned by <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getYear(java.lang.Object)">getYear</A></B>(java.lang.Object&nbsp;date)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the year value of the specified date.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#setTimeZone(java.util.TimeZone)">setTimeZone</A></B>(java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Calendar</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toCalendar(java.lang.Object)">toCalendar</A></B>(java.lang.Object&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts an object to an instance of <CODE>Calendar</CODE> using the
locale returned by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A> if necessary.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Calendar</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toCalendar(java.lang.Object, java.util.Locale)">toCalendar</A></B>(java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts an object to an instance of <CODE>Calendar</CODE> using the
locale returned by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A> if necessary.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate(java.lang.Object)">toDate</A></B>(java.lang.Object&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts an object to an instance of <CODE>Date</CODE> using the
format returned by <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat()"><CODE>FormatConfig.getFormat()</CODE></A>,the <CODE>Locale</CODE> returned
by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>, and the <CODE>TimeZone</CODE> returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone()"><CODE>getTimeZone()</CODE></A> if the object is not already an instance
of Date, Calendar, or Long.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate(java.lang.String, java.lang.Object)">toDate</A></B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts an object to an instance of <CODE>Date</CODE> using the
specified format,the <CODE>Locale</CODE> returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>, and the <CODE>TimeZone</CODE> returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone()"><CODE>getTimeZone()</CODE></A> if the object is not already an instance
of Date, Calendar, or Long.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate(java.lang.String, java.lang.Object, java.util.Locale)">toDate</A></B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts an object to an instance of <CODE>Date</CODE> using the
specified format and <CODE>Locale</CODE> if the object is not already
an instance of Date, Calendar, or Long.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Date</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)">toDate</A></B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts an object to an instance of <CODE>Date</CODE> using the
specified format, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE> if the
object is not already an instance of Date, Calendar, or Long.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toString()">toString</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.velocity.tools.generic.FormatConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat()">getFormat</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#setFormat(java.lang.String)">setFormat</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.velocity.tools.generic.LocaleConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html" title="class in org.apache.velocity.tools.generic">LocaleConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()">getLocale</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#setLocale(java.util.Locale)">setLocale</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.velocity.tools.generic.SafeConfig"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.velocity.tools.generic.<A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#configure(java.util.Map)">configure</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isConfigLocked()">isConfigLocked</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#isSafeMode()">isSafeMode</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setLockConfig(boolean)">setLockConfig</A>, <A HREF="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#setSafeMode(boolean)">setSafeMode</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="DEFAULT_FORMAT_KEY"><!-- --></A><H3>
DEFAULT_FORMAT_KEY</H3>
<PRE>
<FONT SIZE="-1">@Deprecated
</FONT>public static final java.lang.String <B>DEFAULT_FORMAT_KEY</B></PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.generic.DateTool.DEFAULT_FORMAT_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_LOCALE_KEY"><!-- --></A><H3>
DEFAULT_LOCALE_KEY</H3>
<PRE>
<FONT SIZE="-1">@Deprecated
</FONT>public static final java.lang.String <B>DEFAULT_LOCALE_KEY</B></PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.generic.DateTool.DEFAULT_LOCALE_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="TIMEZONE_KEY"><!-- --></A><H3>
TIMEZONE_KEY</H3>
<PRE>
public static final java.lang.String <B>TIMEZONE_KEY</B></PRE>
<DL>
<DD>The key used for specifying a default timezone via tool configuration.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.generic.DateTool.TIMEZONE_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="timezone"><!-- --></A><H3>
timezone</H3>
<PRE>
private java.util.TimeZone <B>timezone</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="DateTool()"><!-- --></A><H3>
DateTool</H3>
<PRE>
public <B>DateTool</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="configure(org.apache.velocity.tools.generic.ValueParser)"><!-- --></A><H3>
configure</H3>
<PRE>
protected void <B>configure</B>(<A HREF="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</A>&nbsp;values)</PRE>
<DL>
<DD>Does the actual configuration. This is protected, so
subclasses may share the same ValueParser and call configure
at any time, while preventing templates from doing so when
configure(Map) is locked.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#configure(org.apache.velocity.tools.generic.ValueParser)">configure</A></CODE> in class <CODE><A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setTimeZone(java.util.TimeZone)"><!-- --></A><H3>
setTimeZone</H3>
<PRE>
protected void <B>setTimeZone</B>(java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getSystemTime()"><!-- --></A><H3>
getSystemTime</H3>
<PRE>
public static final long <B>getSystemTime</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>the system's current time as the number of milliseconds
elapsed since January 1, 1970, 00:00:00 GMT.</DL>
</DD>
</DL>
<HR>
<A NAME="getSystemDate()"><!-- --></A><H3>
getSystemDate</H3>
<PRE>
public static final java.util.Date <B>getSystemDate</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>the system's current time as a <CODE>Date</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getSystemCalendar()"><!-- --></A><H3>
getSystemCalendar</H3>
<PRE>
public static final java.util.Calendar <B>getSystemCalendar</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>the system's current time as a <CODE>Calendar</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getTimeZone()"><!-- --></A><H3>
getTimeZone</H3>
<PRE>
public java.util.TimeZone <B>getTimeZone</B>()</PRE>
<DL>
<DD>Returns the configured <CODE>TimeZone</CODE>. Default value is
from <CODE>TimeZone.getDefault()</CODE>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the configured <CODE>TimeZone</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getDate()"><!-- --></A><H3>
getDate</H3>
<PRE>
public java.util.Date <B>getDate</B>()</PRE>
<DL>
<DD>Returns a <CODE>Date</CODE> derived from the result of <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a <CODE>Date</CODE> derived from the result of <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getCalendar()"><!-- --></A><H3>
getCalendar</H3>
<PRE>
public java.util.Calendar <B>getCalendar</B>()</PRE>
<DL>
<DD>Returns a <CODE>Calendar</CODE> instance created using the timezone and
locale returned by getTimeZone() and getLocale(). This allows subclasses
to easily override the default locale and timezone used by this tool.
<p>Sub-classes may override this method to return a Calendar instance
not based on the system date.
Doing so will also cause the getDate(), get(String), get(String,String),
and toString() methods to return dates equivalent to the Calendar
returned by this method, because those methods return values derived
from the result of this method.</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a <CODE>Calendar</CODE> instance created using the results of
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone()"><CODE>getTimeZone()</CODE></A> and <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>.<DT><B>See Also:</B><DD><CODE>Calendar.getInstance(TimeZone zone, Locale aLocale)</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getYear()"><!-- --></A><H3>
getYear</H3>
<PRE>
public java.lang.Integer <B>getYear</B>()</PRE>
<DL>
<DD>Returns the year value of the date returned by <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getYear(java.lang.Object)"><!-- --></A><H3>
getYear</H3>
<PRE>
public java.lang.Integer <B>getYear</B>(java.lang.Object&nbsp;date)</PRE>
<DL>
<DD>Returns the year value of the specified date.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getMonth()"><!-- --></A><H3>
getMonth</H3>
<PRE>
public java.lang.Integer <B>getMonth</B>()</PRE>
<DL>
<DD>Returns the month value of the date returned by <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getMonth(java.lang.Object)"><!-- --></A><H3>
getMonth</H3>
<PRE>
public java.lang.Integer <B>getMonth</B>(java.lang.Object&nbsp;date)</PRE>
<DL>
<DD>Returns the month value of the specified date.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDay()"><!-- --></A><H3>
getDay</H3>
<PRE>
public java.lang.Integer <B>getDay</B>()</PRE>
<DL>
<DD>Returns the day (of the month) value of the date
returned by <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A>.
<br><br>
NOTE: Unlike java.util.Date, this returns the day of the month.
It is equivalent to Date.getDate() and
Calendar.get(Calendar.DAY_OF_MONTH). We could not call this method
getDate() because that already exists in this class with a different
function.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDay(java.lang.Object)"><!-- --></A><H3>
getDay</H3>
<PRE>
public java.lang.Integer <B>getDay</B>(java.lang.Object&nbsp;date)</PRE>
<DL>
<DD>Returns the day (of the month) value for the specified date.
<br><br>
NOTE: Unlike java.util.Date, this returns the day of the month.
It is equivalent to Date.getDate() and
Calendar.get(Calendar.DAY_OF_MONTH). We could not call this method
getDate() because that already exists in this class with a different
function.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getValue(java.lang.Object)"><!-- --></A><H3>
getValue</H3>
<PRE>
public java.lang.Integer <B>getValue</B>(java.lang.Object&nbsp;field)</PRE>
<DL>
<DD>Return the specified value of the date returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar()"><CODE>getCalendar()</CODE></A> or null if the field is invalid.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getValue(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
getValue</H3>
<PRE>
public java.lang.Integer <B>getValue</B>(java.lang.Object&nbsp;field,
java.lang.Object&nbsp;date)</PRE>
<DL>
<DD>Returns the specified value of the specified date,
or null if the field or date is invalid. The field may be
an Integer or it may be the name of the field as a String.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - the corresponding Integer value or String name of the desired value<DD><CODE>date</CODE> - the date/calendar from which the field value will be taken<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getValue(int, java.lang.Object)"><!-- --></A><H3>
getValue</H3>
<PRE>
public java.lang.Integer <B>getValue</B>(int&nbsp;field,
java.lang.Object&nbsp;date)</PRE>
<DL>
<DD>Returns the specified value of the specified date,
or null if the field or date is invalid.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>field</CODE> - the int for the desired field (e.g. Calendar.MONTH)<DD><CODE>date</CODE> - the date/calendar from which the field value will be taken<DT><B>Since:</B></DT>
<DD>VelocityTools 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.String)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.String <B>get</B>(java.lang.String&nbsp;format)</PRE>
<DL>
<DD>Returns a formatted string representing the date returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A>. In its default implementation, this method
allows you to retrieve the current date in standard formats by
simply doing things like <code>$date.medium</code> or
<code>$date.full</code>. If you want only the date or time portion
you can specify that along with the standard formats. (e.g.
<code>$date.medium_date</code> or <code>$date.short_time</code>)
More complex or custom formats can be retrieved
by using the full method syntax. (e.g. $date.get('E, MMMM d'))
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - the formatting instructions
<DT><B>Returns:</B><DD>a formatted representation of the date returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A><DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String format, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="get(java.lang.String, java.lang.String)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.String <B>get</B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle)</PRE>
<DL>
<DD>Returns a formatted string representing the date and/or time given by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A> in standard, localized patterns.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - the style pattern for the date<DD><CODE>timeStyle</CODE> - the style pattern for the time
<DT><B>Returns:</B><DD>a formatted representation of the date returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A><DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><CODE>DateFormat</CODE>,
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String dateStyle, String timeStyle, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.Object)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.Object&nbsp;obj)</PRE>
<DL>
<DD>Converts the specified object to a date and formats it according to
the pattern or style returned by <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat()"><CODE>FormatConfig.getFormat()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the date object to be formatted
<DT><B>Returns:</B><DD>the specified date formatted as a string<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String format, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.String, java.lang.Object)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj)</PRE>
<DL>
<DD>Converts the specified object to a date and returns
a formatted string representing that date in the locale
returned by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - the formatting instructions<DD><CODE>obj</CODE> - the date object to be formatted
<DT><B>Returns:</B><DD>a formatted string for this locale representing the specified
date or <code>null</code> if the parameters are invalid<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String format, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.String, java.lang.Object, java.util.Locale)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</PRE>
<DL>
<DD>Converts the specified object to a date and returns
a formatted string representing that date in the specified
<CODE>Locale</CODE>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - the formatting instructions<DD><CODE>obj</CODE> - the date object to be formatted<DD><CODE>locale</CODE> - the locale to be used when formatting
<DT><B>Returns:</B><DD>the given date as a formatted string<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String format, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD>Returns a formatted string representing the specified date,
<CODE>Locale</CODE>, and <CODE>TimeZone</CODE>.
<p>
The specified format may be a standard style pattern ('full', 'long',
'medium', 'short', or 'default').
</p>
<p>
You may also specify that you want only the date or time portion be
appending '_date' or '_time' respectively to the standard style pattern.
(e.g. 'full_date' or 'long_time')
</p>
<p>
If the format fits neither of these patterns, then the output
will be formatted according to the symbols defined by
<CODE>SimpleDateFormat</CODE>:
<pre>
Symbol Meaning Presentation Example
------ ------- ------------ -------
G era designator (Text) AD
y year (Number) 1996
M month in year (Text & Number) July & 07
d day in month (Number) 10
h hour in am/pm (1~12) (Number) 12
H hour in day (0~23) (Number) 0
m minute in hour (Number) 30
s second in minute (Number) 55
S millisecond (Number) 978
E day in week (Text) Tuesday
D day in year (Number) 189
F day of week in month (Number) 2 (2nd Wed in July)
w week in year (Number) 27
W week in month (Number) 2
a am/pm marker (Text) PM
k hour in day (1~24) (Number) 24
K hour in am/pm (0~11) (Number) 0
z time zone (Text) Pacific Standard Time
' escape for text (Delimiter)
'' single quote (Literal) '
Examples: "E, MMMM d" will result in "Tue, July 24"
"EEE, M-d (H:m)" will result in "Tuesday, 7-24 (14:12)"
</pre>
</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - the custom or standard pattern to be used<DD><CODE>obj</CODE> - the date to format<DD><CODE>locale</CODE> - the <CODE>Locale</CODE> to format the date for<DD><CODE>timezone</CODE> - the <CODE>TimeZone</CODE> to be used when formatting
<DT><B>Returns:</B><DD>a formatted string representing the specified date or
<code>null</code> if the parameters are invalid<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.String, java.lang.String, java.lang.Object)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.lang.Object&nbsp;obj)</PRE>
<DL>
<DD>Returns the specified date as a string formatted according to the
specified date and/or time styles.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - the style pattern for the date<DD><CODE>timeStyle</CODE> - the style pattern for the time<DD><CODE>obj</CODE> - the date to be formatted
<DT><B>Returns:</B><DD>a formatted representation of the given date<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String dateStyle, String timeStyle, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</PRE>
<DL>
<DD>Returns the specified date as a string formatted according to the
specified <CODE>Locale</CODE> and date and/or time styles.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - the style pattern for the date<DD><CODE>timeStyle</CODE> - the style pattern for the time<DD><CODE>obj</CODE> - the date to be formatted<DD><CODE>locale</CODE> - the <CODE>Locale</CODE> to be used for formatting the date
<DT><B>Returns:</B><DD>a formatted representation of the given date<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String dateStyle, String timeStyle, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><!-- --></A><H3>
format</H3>
<PRE>
public java.lang.String <B>format</B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD>Returns the specified date as a string formatted according to the
specified <CODE>Locale</CODE> and date and/or time styles.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - the style pattern for the date<DD><CODE>timeStyle</CODE> - the style pattern for the time<DD><CODE>obj</CODE> - the date to be formatted<DD><CODE>locale</CODE> - the <CODE>Locale</CODE> to be used for formatting the date<DD><CODE>timezone</CODE> - the <CODE>TimeZone</CODE> the date should be formatted for
<DT><B>Returns:</B><DD>a formatted representation of the given date<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><CODE>DateFormat</CODE>,
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><CODE>format(String dateStyle, String timeStyle, Object obj, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getDateFormat(java.lang.String, java.util.Locale, java.util.TimeZone)"><!-- --></A><H3>
getDateFormat</H3>
<PRE>
public java.text.DateFormat <B>getDateFormat</B>(java.lang.String&nbsp;format,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD>Returns a <CODE>DateFormat</CODE> instance for the specified
format, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE>. If the format
specified is a standard style pattern, then a date-time instance
will be returned with both the date and time styles set to the
specified style. If it is a custom format, then a customized
<CODE>SimpleDateFormat</CODE> will be returned.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - the custom or standard formatting pattern to be used<DD><CODE>locale</CODE> - the <CODE>Locale</CODE> to be used<DD><CODE>timezone</CODE> - the <CODE>TimeZone</CODE> to be used
<DT><B>Returns:</B><DD>an instance of <CODE>DateFormat</CODE><DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><CODE>SimpleDateFormat</CODE>,
<CODE>DateFormat</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getDateFormat(java.lang.String, java.lang.String, java.util.Locale, java.util.TimeZone)"><!-- --></A><H3>
getDateFormat</H3>
<PRE>
public java.text.DateFormat <B>getDateFormat</B>(java.lang.String&nbsp;dateStyle,
java.lang.String&nbsp;timeStyle,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD>Returns a <CODE>DateFormat</CODE> instance for the specified
date style, time style, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - the date style<DD><CODE>timeStyle</CODE> - the time style<DD><CODE>locale</CODE> - the <CODE>Locale</CODE> to be used<DD><CODE>timezone</CODE> - the <CODE>TimeZone</CODE> to be used
<DT><B>Returns:</B><DD>an instance of <CODE>DateFormat</CODE><DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat(int, int, java.util.Locale, java.util.TimeZone)"><CODE>getDateFormat(int timeStyle, int dateStyle, Locale locale, TimeZone timezone)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getDateFormat(int, int, java.util.Locale, java.util.TimeZone)"><!-- --></A><H3>
getDateFormat</H3>
<PRE>
<FONT SIZE="-1">@Deprecated
</FONT>protected java.text.DateFormat <B>getDateFormat</B>(int&nbsp;dateStyle,
int&nbsp;timeStyle,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;
<P>
<DD>Returns a <CODE>DateFormat</CODE> instance for the specified
time style, date style, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dateStyle</CODE> - the date style (date will be ignored if this is
less than zero and the date style is not)<DD><CODE>timeStyle</CODE> - the time style (time will be ignored if this is
less than zero and the date style is not)<DD><CODE>locale</CODE> - the <CODE>Locale</CODE> to be used<DD><CODE>timezone</CODE> - the <CODE>TimeZone</CODE> to be used
<DT><B>Returns:</B><DD>an instance of <CODE>DateFormat</CODE> or <code>null</code>
if an instance cannot be constructed with the given
parameters<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getStyleAsInt(java.lang.String)"><!-- --></A><H3>
getStyleAsInt</H3>
<PRE>
<FONT SIZE="-1">@Deprecated
</FONT>protected int <B>getStyleAsInt</B>(java.lang.String&nbsp;style)</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;
<P>
<DD>Checks a string to see if it matches one of the standard DateFormat
style patterns: FULL, LONG, MEDIUM, SHORT, or DEFAULT. If it does,
it will return the integer constant for that pattern. If not, it
will return -1.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>style</CODE> - the string to be checked
<DT><B>Returns:</B><DD>the int identifying the style pattern<DT><B>Since:</B></DT>
<DD>VelocityTools 1.1</DD>
<DT><B>See Also:</B><DD><CODE>DateFormat</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="toDate(java.lang.Object)"><!-- --></A><H3>
toDate</H3>
<PRE>
public java.util.Date <B>toDate</B>(java.lang.Object&nbsp;obj)</PRE>
<DL>
<DD>Converts an object to an instance of <CODE>Date</CODE> using the
format returned by <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat()"><CODE>FormatConfig.getFormat()</CODE></A>,the <CODE>Locale</CODE> returned
by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>, and the <CODE>TimeZone</CODE> returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone()"><CODE>getTimeZone()</CODE></A> if the object is not already an instance
of Date, Calendar, or Long.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the date to convert
<DT><B>Returns:</B><DD>the object as a <CODE>Date</CODE> or <code>null</code> if no
conversion is possible</DL>
</DD>
</DL>
<HR>
<A NAME="toDate(java.lang.String, java.lang.Object)"><!-- --></A><H3>
toDate</H3>
<PRE>
public java.util.Date <B>toDate</B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj)</PRE>
<DL>
<DD>Converts an object to an instance of <CODE>Date</CODE> using the
specified format,the <CODE>Locale</CODE> returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A>, and the <CODE>TimeZone</CODE> returned by
<A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone()"><CODE>getTimeZone()</CODE></A> if the object is not already an instance
of Date, Calendar, or Long.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - - the format the date is in<DD><CODE>obj</CODE> - - the date to convert
<DT><B>Returns:</B><DD>the object as a <CODE>Date</CODE> or <code>null</code> if no
conversion is possible<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate(java.lang.String, java.lang.Object, java.util.Locale)"><CODE>toDate(String format, Object obj, Locale locale)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="toDate(java.lang.String, java.lang.Object, java.util.Locale)"><!-- --></A><H3>
toDate</H3>
<PRE>
public java.util.Date <B>toDate</B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</PRE>
<DL>
<DD>Converts an object to an instance of <CODE>Date</CODE> using the
specified format and <CODE>Locale</CODE> if the object is not already
an instance of Date, Calendar, or Long.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - - the format the date is in<DD><CODE>obj</CODE> - - the date to convert<DD><CODE>locale</CODE> - - the <CODE>Locale</CODE>
<DT><B>Returns:</B><DD>the object as a <CODE>Date</CODE> or <code>null</code> if no
conversion is possible<DT><B>See Also:</B><DD><CODE>SimpleDateFormat.parse(java.lang.String, java.text.ParsePosition)</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="toDate(java.lang.String, java.lang.Object, java.util.Locale, java.util.TimeZone)"><!-- --></A><H3>
toDate</H3>
<PRE>
public java.util.Date <B>toDate</B>(java.lang.String&nbsp;format,
java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale,
java.util.TimeZone&nbsp;timezone)</PRE>
<DL>
<DD>Converts an object to an instance of <CODE>Date</CODE> using the
specified format, <CODE>Locale</CODE>, and <CODE>TimeZone</CODE> if the
object is not already an instance of Date, Calendar, or Long.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>format</CODE> - - the format the date is in<DD><CODE>obj</CODE> - - the date to convert<DD><CODE>locale</CODE> - - the <CODE>Locale</CODE><DD><CODE>timezone</CODE> - - the <CODE>TimeZone</CODE>
<DT><B>Returns:</B><DD>the object as a <CODE>Date</CODE> or <code>null</code> if no
conversion is possible<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat(java.lang.String, java.util.Locale, java.util.TimeZone)"><CODE>getDateFormat(java.lang.String, java.util.Locale, java.util.TimeZone)</CODE></A>,
<CODE>SimpleDateFormat.parse(java.lang.String, java.text.ParsePosition)</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="toCalendar(java.lang.Object)"><!-- --></A><H3>
toCalendar</H3>
<PRE>
public java.util.Calendar <B>toCalendar</B>(java.lang.Object&nbsp;obj)</PRE>
<DL>
<DD>Converts an object to an instance of <CODE>Calendar</CODE> using the
locale returned by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A> if necessary.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the date to convert
<DT><B>Returns:</B><DD>the converted date<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toCalendar(java.lang.Object, java.util.Locale)"><CODE>toCalendar(Object obj, Locale locale)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="toCalendar(java.lang.Object, java.util.Locale)"><!-- --></A><H3>
toCalendar</H3>
<PRE>
public java.util.Calendar <B>toCalendar</B>(java.lang.Object&nbsp;obj,
java.util.Locale&nbsp;locale)</PRE>
<DL>
<DD>Converts an object to an instance of <CODE>Calendar</CODE> using the
locale returned by <A HREF="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale()"><CODE>LocaleConfig.getLocale()</CODE></A> if necessary.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - the date to convert<DD><CODE>locale</CODE> - the locale used
<DT><B>Returns:</B><DD>the converted date<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate(java.lang.String, java.lang.Object, java.util.Locale)"><CODE>toDate(String format, Object obj, Locale locale)</CODE></A>,
<CODE>Calendar</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>the result of <A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate()"><CODE>getDate()</CODE></A> formatted according to the result
of <A HREF="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat()"><CODE>FormatConfig.getFormat()</CODE></A>.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/generic/DateTool.html#format(java.lang.String, java.lang.Object)"><CODE>format(String format, Object obj)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/ConversionTool.html" title="class in org.apache.velocity.tools.generic"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/generic/DisplayTool.html" title="class in org.apache.velocity.tools.generic"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/velocity/tools/generic/DateTool.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DateTool.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright (c) 2003-2007 Apache Software Foundation
</BODY>
</HTML>