velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Brisson <cla...@renegat.net>
Subject Re: How do I set a TimeZone for VelocityTools DateTool?
Date Thu, 16 Aug 2012 13:14:44 GMT
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 <doug.breaux@gmail.com> 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: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message