Freemarker/Velocity - date manipulation

Posted by Razor on Stack Overflow See other posts from Stack Overflow or by Razor
Published on 2010-04-09T14:56:49Z Indexed on 2010/04/09 15:13 UTC
Read the original article Hit count: 706

Filed under:
|
|

Hello, I have a fairly simple question about these 2 templating engines.
I'm trying to make a future/paste date, a fixed time from now, e.g. 18 months ago, or tomorrow.

I know that it is possible to do this with a java date object inside a velocity/freemarker template (something like $date.add(2,-18)), but I would like to do this with DateTool or freemarker core.

This is something that I see as purely presentational (just think at the default dates you see in flight booking forms), so I can't see any reason why a templating engine shouldn't be able to do this.

Is it possible though? If so, how?

© Stack Overflow or respective owner

Related posts about java

Related posts about freemarker