Re: How do I set a TimeZone for VelocityTools DateTool?

Claude Brisson <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <20120816151444.09e11818@titan>
My answer on StackOverflow:

To pass configuration values to standard tools, you have to explicitly
list them in your WEB-INF/tools.xml file:

<?xml version="1.0"?>
<tools>
  <toolbox scope="application">
    <tool key="date"
          class="org.apache.velocity.tools.generic.DateTool"
          timezone="GMT+7"/>
    ...
  </toolbox>
  ...
</tools>
Please note that you can use the
org.apache.velocity.tools.generic.ComparisonDateTool for the same
purpose, which adds some nice date-time comparison features.


  Claude

On Tue, 14 Aug 2012 16:20:30 -0500
Doug Breaux <[email protected]> wrote:

> Both the VelocityTools Tools Usage Summary and the DateTool Javadoc
> seem to indicate a configuration mechanism for setting a TimeZone,
> but I simply can't discover what that is.
> 
> DateTool's timezone setter is protected, and I don't want repeatedly 
> pass a TimeZone into the overloaded format() methods.
> 
> VelocityTools 2.0
> 
> (Also asked on StackOverflow if you want to answer there
> http://stackoverflow.com/questions/11907365/how-do-i-set-a-timezone-for-velocitytools-datetool 
> )
> 
> Doug
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.