blob: d18a83d225e6712d7a64fb181bdf622866cd7324 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_171) on Wed Jun 20 14:25:31 CEST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DateTool (VelocityTools 3.0-SNAPSHOT API)</title>
<meta name="date" content="2018-06-20">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DateTool (VelocityTools 3.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":9,"i19":9,"i20":9,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DateTool.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/velocity/tools/generic/ConversionTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/velocity/tools/generic/DisplayTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/velocity/tools/generic/DateTool.html" target="_top">Frames</a></li>
<li><a href="DateTool.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.velocity.tools.generic</div>
<h2 title="Class DateTool" class="title">Class DateTool</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.SafeConfig</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.LocaleConfig</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">org.apache.velocity.tools.generic.FormatConfig</a></li>
<li>
<ul class="inheritance">
<li>org.apache.velocity.tools.generic.DateTool</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/velocity/tools/generic/ComparisonDateTool.html" title="class in org.apache.velocity.tools.generic">ComparisonDateTool</a></dd>
</dl>
<hr>
<br>
<pre><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")
public class <span class="typeNameLabel">DateTool</span>
extends <a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</a>
implements <a href="https://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block"><p>Tool for working with <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a>
in Velocity templates. It is useful for accessing and
formatting the "current" date as well as for formatting
arbitrary <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> objects. Also
the tool can be used to retrieve <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a> instances
or make conversions to and from various date types.</p>
<p>Possible formats include:</p>
<ul>
<li>'short', 'medium', 'long', 'full' (from <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a>, optionally suffixed by '_date' or '_time' to get a date-only or time-only format</li>
<li>'iso' for extended ISO 8601 without time zone (ex: '2016-11-24T10:27:30'), optionally suffixed by '_date' or '_time' to get a date-only or time-only format</li>
<li>'iso_tz', like 'iso' with time zone offset (ex: '2016-11-24T10:27:30+01:00'), optionally suffixed by '_time' to get a time-only format ('10:27:30+01:00')</li>
<li>'intl', like 'iso' but with a space separator between date and time (ex: '2016-11-24 10:27:30'), optionally suffixed by '_date' or '_time' to get a date-only or time-only format</li>
<li>'intl_tz', like 'intl' but with the time zone short id suffixed after another space (ex: '2016-11-24 10:27:30 CET'), optionally suffixed by '_time' to get a time-only format ('10:27:30+01:00')</li>
<li>a custom format, as specified in <a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true" title="class or interface in java.text"><code>SimpleDateFormat</code></a></li>
</ul>
<p>Example of formatting the "current" date:</p>
<pre>
$date -&gt; Oct 19, 2003 9:54:50 PM
$date.long -&gt; October 19, 2003 9:54:50 PM PDT
$date.medium_time -&gt; 9:54:50 PM
$date.full_date -&gt; Sunday, October 19, 2003
$date.get('default','short') -&gt; Oct 19, 2003 9:54 PM
$date.get('yyyy-M-d H:m:s') -&gt; 2003-10-19 21:54:50
$date.iso -&gt; 2003-10-19T21:54:50-07:00
$date.iso_tz_time -&gt; 21:54:50-07:00
$date.intl_tz -&gt; 2003-10-19 21:54:50 CET
Example of formatting an arbitrary date:
$myDate -&gt; Tue Oct 07 03:14:50 PDT 2003
$date.format('medium',$myDate) -&gt; 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>Should you need to use several formats, you can either use explicit formats by means of the <code>toDate(format, date)</code> method,
or you can declare several date tool instances with different formats.</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></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.0</dd>
<dt><span class="simpleTagLabel">Version:</span></dt>
<dd>$Revision: 1773487 $ $Date: 2016-12-10 00:21:33 +0100 (sam., 10 déc. 2016) $</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Nathan Bubna</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.velocity.tools.generic.DateTool">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#TIMEZONE_KEY">TIMEZONE_KEY</a></span></code>
<div class="block">The key used for specifying a default timezone via tool configuration.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.FormatConfig">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</a></h3>
<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></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.LocaleConfig">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html" title="class in org.apache.velocity.tools.generic">LocaleConfig</a></h3>
<code><a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#DEFAULT_LOCALE">DEFAULT_LOCALE</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3>
<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#log">log</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#LOGGER_NAME_KEY">LOGGER_NAME_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#SAFE_MODE_KEY">SAFE_MODE_KEY</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#USE_CLASS_LOGGER_KEY">USE_CLASS_LOGGER_KEY</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#DateTool--">DateTool</a></span>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></span>(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a>&nbsp;values)</code>
<div class="block">Does the actual configuration.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#format-java.lang.Object-">format</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">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>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#format-java.lang.String-java.lang.Object-">format</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">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>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#format-java.lang.String-java.lang.Object-java.util.Locale-">format</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</code>
<div class="block">Converts the specified object to a date and returns
a formatted string representing that date in the specified
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#format-java.lang.String-java.lang.Object-java.util.Locale-java.util.TimeZone-">format</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</code>
<div class="block">Returns a formatted string representing the specified date,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#format-java.lang.String-java.lang.String-java.lang.Object-">format</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Returns the specified date as a string formatted according to the
specified date and/or time styles.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#format-java.lang.String-java.lang.String-java.lang.Object-java.util.Locale-">format</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</code>
<div class="block">Returns the specified date as a string formatted according to the
specified <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> and date and/or time styles.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><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></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</code>
<div class="block">Returns the specified date as a string formatted according to the
specified <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> and date and/or time styles.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#get-java.lang.String-">get</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format)</code>
<div class="block">Returns a formatted string representing the date returned by
<a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate--"><code>getDate()</code></a>.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#get-java.lang.String-java.lang.String-">get</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle)</code>
<div class="block">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.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--">getCalendar</a></span>()</code>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> instance created using the timezone and
locale returned by getTimeZone() and getLocale().</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate--">getDate</a></span>()</code>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> derived from the result of <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a></div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text">DateFormat</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat-java.lang.String-java.util.Locale-java.util.TimeZone-">getDateFormat</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</code>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a> instance for the specified
format, <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text">DateFormat</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDateFormat-java.lang.String-java.lang.String-java.util.Locale-java.util.TimeZone-">getDateFormat</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</code>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a> instance for the specified
date style, time style, <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDay--">getDay</a></span>()</code>
<div class="block">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>.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDay-java.lang.Object-">getDay</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</code>
<div class="block">Returns the day (of the month) value for the specified date.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getMonth--">getMonth</a></span>()</code>
<div class="block">Returns the month value of the date returned by <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a>.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getMonth-java.lang.Object-">getMonth</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</code>
<div class="block">Returns the month value of the specified date.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getSystemCalendar--">getSystemCalendar</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getSystemDate--">getSystemDate</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getSystemTime--">getSystemTime</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getTimeZone--">getTimeZone</a></span>()</code>
<div class="block">Returns the configured <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getValue-int-java.lang.Object-">getValue</a></span>(int&nbsp;field,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</code>
<div class="block">Returns the specified value of the specified date,
or null if the field or date is invalid.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getValue-java.lang.Object-">getValue</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;field)</code>
<div class="block">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.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getValue-java.lang.Object-java.lang.Object-">getValue</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;field,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</code>
<div class="block">Returns the specified value of the specified date,
or null if the field or date is invalid.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getYear--">getYear</a></span>()</code>
<div class="block">Returns the year value of the date returned by <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a>.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getYear-java.lang.Object-">getYear</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</code>
<div class="block">Returns the year value of the specified date.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#setTimeZone-java.util.TimeZone-">setTimeZone</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</code>&nbsp;</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toCalendar-java.lang.Object-">toCalendar</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> using the
locale returned by <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a> if necessary.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toCalendar-java.lang.Object-java.util.Locale-">toCalendar</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</code>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> using the
locale returned by <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a> if necessary.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate-java.lang.Object-">toDate</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
format returned by <a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat--"><code>FormatConfig.getFormat()</code></a>,the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> returned
by <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a>, and the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> 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.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate-java.lang.String-java.lang.Object-">toDate</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</code>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
specified format,the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> returned by
<a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a>, and the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> 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.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate-java.lang.String-java.lang.Object-java.util.Locale-">toDate</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</code>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
specified format and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> if the object is not already
an instance of Date, Calendar, or Long.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toDate-java.lang.String-java.lang.Object-java.util.Locale-java.util.TimeZone-">toDate</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</code>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
specified format, <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> if the
object is not already an instance of Date, Calendar, or Long.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toLocalizedPattern-java.lang.String-java.util.Locale-">toLocalizedPattern</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</code>
<div class="block">Returns a localized date format pattern for the given format.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.FormatConfig">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</a></h3>
<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></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.LocaleConfig">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html" title="class in org.apache.velocity.tools.generic">LocaleConfig</a></h3>
<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>, <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#toLocale-java.lang.Object-">toLocale</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.velocity.tools.generic.SafeConfig">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.velocity.tools.generic.<a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html" title="class in org.apache.velocity.tools.generic">SafeConfig</a></h3>
<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#getLog--">getLog</a>, <a href="../../../../../org/apache/velocity/tools/generic/SafeConfig.html#initLogger-org.apache.velocity.tools.generic.ValueParser-">initLogger</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></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="TIMEZONE_KEY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TIMEZONE_KEY</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> TIMEZONE_KEY</pre>
<div class="block">The key used for specifying a default timezone via tool configuration.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.velocity.tools.generic.DateTool.TIMEZONE_KEY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="DateTool--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DateTool</h4>
<pre>public&nbsp;DateTool()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="configure-org.apache.velocity.tools.generic.ValueParser-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>configure</h4>
<pre>protected&nbsp;void&nbsp;configure(<a href="../../../../../org/apache/velocity/tools/generic/ValueParser.html" title="class in org.apache.velocity.tools.generic">ValueParser</a>&nbsp;values)</pre>
<div class="block">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.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#configure-org.apache.velocity.tools.generic.ValueParser-">configure</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html" title="class in org.apache.velocity.tools.generic">FormatConfig</a></code></dd>
</dl>
</li>
</ul>
<a name="setTimeZone-java.util.TimeZone-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTimeZone</h4>
<pre>protected&nbsp;void&nbsp;setTimeZone(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</pre>
</li>
</ul>
<a name="getSystemTime--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSystemTime</h4>
<pre>public static final&nbsp;long&nbsp;getSystemTime()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the system's current time as the number of milliseconds
elapsed since January 1, 1970, 00:00:00 GMT.</dd>
</dl>
</li>
</ul>
<a name="getSystemDate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSystemDate</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;getSystemDate()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the system's current time as a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a></dd>
</dl>
</li>
</ul>
<a name="getSystemCalendar--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSystemCalendar</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a>&nbsp;getSystemCalendar()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the system's current time as a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a></dd>
</dl>
</li>
</ul>
<a name="getTimeZone--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTimeZone</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;getTimeZone()</pre>
<div class="block">Returns the configured <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>. Default value is
from <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true#getDefault--" title="class or interface in java.util"><code>TimeZone.getDefault()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the configured <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a></dd>
</dl>
</li>
</ul>
<a name="getDate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDate</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;getDate()</pre>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> derived from the result of <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> derived from the result of <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a></dd>
</dl>
</li>
</ul>
<a name="getCalendar--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCalendar</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a>&nbsp;getCalendar()</pre>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> 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></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> 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>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true#getInstance-java.util.TimeZone-java.util.Locale-" title="class or interface in java.util"><code>Calendar.getInstance(TimeZone zone, Locale aLocale)</code></a></dd>
</dl>
</li>
</ul>
<a name="getYear--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getYear</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getYear()</pre>
<div class="block">Returns the year value of the date returned by <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a>.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getYear-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getYear</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getYear(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</pre>
<div class="block">Returns the year value of the specified date.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getMonth--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMonth</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getMonth()</pre>
<div class="block">Returns the month value of the date returned by <a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getCalendar--"><code>getCalendar()</code></a>.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getMonth-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMonth</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getMonth(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</pre>
<div class="block">Returns the month value of the specified date.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getDay--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDay</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getDay()</pre>
<div class="block">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.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getDay-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDay</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getDay(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</pre>
<div class="block">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.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getValue-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getValue(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;field)</pre>
<div class="block">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.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getValue-java.lang.Object-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getValue(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;field,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</pre>
<div class="block">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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>field</code> - the corresponding Integer value or String name of the desired value</dd>
<dd><code>date</code> - the date/calendar from which the field value will be taken</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="getValue-int-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&nbsp;getValue(int&nbsp;field,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;date)</pre>
<div class="block">Returns the specified value of the specified date,
or null if the field or date is invalid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>field</code> - the int for the desired field (e.g. Calendar.MONTH)</dd>
<dd><code>date</code> - the date/calendar from which the field value will be taken</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.2</dd>
</dl>
</li>
</ul>
<a name="get-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;get(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format)</pre>
<div class="block">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'))</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the formatting instructions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted representation of the date returned by
<a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate--"><code>getDate()</code></a></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="get-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;get(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle)</pre>
<div class="block">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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dateStyle</code> - the style pattern for the date</dd>
<dd><code>timeStyle</code> - the style pattern for the time</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted representation of the date returned by
<a href="../../../../../org/apache/velocity/tools/generic/DateTool.html#getDate--"><code>getDate()</code></a></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a>,
<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></dd>
</dl>
</li>
</ul>
<a name="format-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">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>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>obj</code> - the date object to be formatted</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the specified date formatted as a string</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="format-java.lang.String-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">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>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the formatting instructions</dd>
<dd><code>obj</code> - the date object to be formatted</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted string for this locale representing the specified
date or <code>null</code> if the parameters are invalid</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="format-java.lang.String-java.lang.Object-java.util.Locale-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</pre>
<div class="block">Converts the specified object to a date and returns
a formatted string representing that date in the specified
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the formatting instructions</dd>
<dd><code>obj</code> - the date object to be formatted</dd>
<dd><code>locale</code> - the locale to be used when formatting</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the given date as a formatted string</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="format-java.lang.String-java.lang.Object-java.util.Locale-java.util.TimeZone-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</pre>
<div class="block">Returns a formatted string representing the specified date,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>.
<p>
The specified format may be a standard style pattern ('full', 'long',
'medium', 'short', or 'default') or extended style pattern ('iso', 'iso_tz', 'intl', 'intl_tz').
</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', 'long_time', 'intl_date')
</p>
<p>
If the format fits neither of these patterns, then the output
will be formatted according to the symbols defined by
<a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true" title="class or interface in java.text"><code>SimpleDateFormat</code></a>.
</p>
<pre>
Examples: "E, MMMM d" will result in "Tue, July 24"
"EEE, M-d (H:m)" will result in "Tuesday, 7-24 (14:12)"
</pre></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the custom or standard pattern to be used</dd>
<dd><code>obj</code> - the date to format</dd>
<dd><code>locale</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> to format the date for</dd>
<dd><code>timezone</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> to be used when formatting</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted string representing the specified date or
<code>null</code> if the parameters are invalid</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
</dl>
</li>
</ul>
<a name="format-java.lang.String-java.lang.String-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Returns the specified date as a string formatted according to the
specified date and/or time styles.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dateStyle</code> - the style pattern for the date</dd>
<dd><code>timeStyle</code> - the style pattern for the time</dd>
<dd><code>obj</code> - the date to be formatted</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted representation of the given date</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="format-java.lang.String-java.lang.String-java.lang.Object-java.util.Locale-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</pre>
<div class="block">Returns the specified date as a string formatted according to the
specified <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> and date and/or time styles.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dateStyle</code> - the style pattern for the date</dd>
<dd><code>timeStyle</code> - the style pattern for the time</dd>
<dd><code>obj</code> - the date to be formatted</dd>
<dd><code>locale</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> to be used for formatting the date</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted representation of the given date</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="format-java.lang.String-java.lang.String-java.lang.Object-java.util.Locale-java.util.TimeZone-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>format</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</pre>
<div class="block">Returns the specified date as a string formatted according to the
specified <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> and date and/or time styles.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dateStyle</code> - the style pattern for the date</dd>
<dd><code>timeStyle</code> - the style pattern for the time</dd>
<dd><code>obj</code> - the date to be formatted</dd>
<dd><code>locale</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> to be used for formatting the date</dd>
<dd><code>timezone</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> the date should be formatted for</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted representation of the given date</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a>,
<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></dd>
</dl>
</li>
</ul>
<a name="getDateFormat-java.lang.String-java.util.Locale-java.util.TimeZone-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDateFormat</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text">DateFormat</a>&nbsp;getDateFormat(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</pre>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a> instance for the specified
format, <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>. 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
<a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true" title="class or interface in java.text"><code>SimpleDateFormat</code></a> will be returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the custom or standard formatting pattern to be used</dd>
<dd><code>locale</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> to be used</dd>
<dd><code>timezone</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> to be used</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true" title="class or interface in java.text"><code>SimpleDateFormat</code></a>,
<a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a></dd>
</dl>
</li>
</ul>
<a name="getDateFormat-java.lang.String-java.lang.String-java.util.Locale-java.util.TimeZone-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDateFormat</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text">DateFormat</a>&nbsp;getDateFormat(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;dateStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;timeStyle,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</pre>
<div class="block">Returns a <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a> instance for the specified
date style, time style, <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dateStyle</code> - the date style</dd>
<dd><code>timeStyle</code> - the time style</dd>
<dd><code>locale</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> to be used</dd>
<dd><code>timezone</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> to be used</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DateFormat.html?is-external=true" title="class or interface in java.text"><code>DateFormat</code></a></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 1.1</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/velocity/tools/ConversionUtils.html#getDateFormat-int-int-java.util.Locale-java.util.TimeZone-"><code>ConversionUtils.getDateFormat(int,int,Locale,TimeZone)</code></a></dd>
</dl>
</li>
</ul>
<a name="toDate-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDate</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;toDate(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
format returned by <a href="../../../../../org/apache/velocity/tools/generic/FormatConfig.html#getFormat--"><code>FormatConfig.getFormat()</code></a>,the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> returned
by <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a>, and the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> 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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>obj</code> - the date to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object as a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> or <code>null</code> if no
conversion is possible</dd>
</dl>
</li>
</ul>
<a name="toDate-java.lang.String-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDate</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;toDate(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
specified format,the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> returned by
<a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a>, and the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> 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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - - the format the date is in</dd>
<dd><code>obj</code> - - the date to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object as a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> or <code>null</code> if no
conversion is possible</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="toDate-java.lang.String-java.lang.Object-java.util.Locale-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDate</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;toDate(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</pre>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
specified format and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> if the object is not already
an instance of Date, Calendar, or Long.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - - the format the date is in</dd>
<dd><code>obj</code> - - the date to convert</dd>
<dd><code>locale</code> - - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object as a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> or <code>null</code> if no
conversion is possible</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true#parse-java.lang.String-java.text.ParsePosition-" title="class or interface in java.text"><code>SimpleDateFormat.parse(java.lang.String, java.text.ParsePosition)</code></a></dd>
</dl>
</li>
</ul>
<a name="toDate-java.lang.String-java.lang.Object-java.util.Locale-java.util.TimeZone-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDate</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util">Date</a>&nbsp;toDate(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util">TimeZone</a>&nbsp;timezone)</pre>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> using the
specified format, <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a>, and <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a> if the
object is not already an instance of Date, Calendar, or Long.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - - the format the date is in</dd>
<dd><code>obj</code> - - the date to convert</dd>
<dd><code>locale</code> - - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a></dd>
<dd><code>timezone</code> - - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html?is-external=true" title="class or interface in java.util"><code>TimeZone</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the object as a <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Date.html?is-external=true" title="class or interface in java.util"><code>Date</code></a> or <code>null</code> if no
conversion is possible</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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>,
<a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true#parse-java.lang.String-java.text.ParsePosition-" title="class or interface in java.text"><code>SimpleDateFormat.parse(java.lang.String, java.text.ParsePosition)</code></a></dd>
</dl>
</li>
</ul>
<a name="toCalendar-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toCalendar</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a>&nbsp;toCalendar(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj)</pre>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> using the
locale returned by <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a> if necessary.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>obj</code> - the date to convert</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the converted date</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
<a name="toCalendar-java.lang.Object-java.util.Locale-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toCalendar</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util">Calendar</a>&nbsp;toCalendar(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;obj,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</pre>
<div class="block">Converts an object to an instance of <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a> using the
locale returned by <a href="../../../../../org/apache/velocity/tools/generic/LocaleConfig.html#getLocale--"><code>LocaleConfig.getLocale()</code></a> if necessary.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>obj</code> - the date to convert</dd>
<dd><code>locale</code> - the locale used</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the converted date</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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>,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html?is-external=true" title="class or interface in java.util"><code>Calendar</code></a></dd>
</dl>
</li>
</ul>
<a name="toLocalizedPattern-java.lang.String-java.util.Locale-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toLocalizedPattern</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toLocalizedPattern(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;format,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util">Locale</a>&nbsp;locale)</pre>
<div class="block">Returns a localized date format pattern for the given format.
SimpleDateFormat uses patterns that are based upon English
words (such as Month = M, Day = d, and Year = y). When displaying
a format pattern to readers of other languages, it is appropriate
to display these patterns using their localized expectations.
For instance, the date pattern yyyy-MM-dd should, for French speakers
appear as "aaaa-MM-jj". <a href="https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html?is-external=true#toLocalizedPattern--" title="class or interface in java.text"><code>SimpleDateFormat.toLocalizedPattern()</code></a>
provides this functionality, and this method merely calls
that on an appropriately-constructed SimpleDateFormat object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>format</code> - the custom or standard pattern to convert</dd>
<dd><code>locale</code> - the <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html?is-external=true" title="class or interface in java.util"><code>Locale</code></a> to format for pattern for</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a format string appropriate for the specified Locale</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>VelocityTools 2.0</dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<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>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<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></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DateTool.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/velocity/tools/generic/ConversionTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/velocity/tools/generic/DisplayTool.html" title="class in org.apache.velocity.tools.generic"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/velocity/tools/generic/DateTool.html" target="_top">Frames</a></li>
<li><a href="DateTool.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2018 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>