Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for a way to retrieve date in velocity template

I'm trying to get the System date in a velocity template, but ModifiedDateTime="$date" results in ModifiedDateTime="$date" instead of ModifiedDateTime="Jan 11, 2011 9:54:50 AM"

All of my other variables and calls work as supposed to, but this is my first Velocity template and everything I can find points at $date.

like image 834
Java Rookie Avatar asked Jan 11 '12 20:01

Java Rookie


People also ask

Is Velocity template deprecated?

Velocity templates were deprecated in Liferay Portal 7.0 and are now removed in favor of FreeMarker templates in Liferay DXP 7.2.

What is velocity .VM file?

Velocity is a Java-based templating engine. It's an open source web framework designed to be used as a view component in the MVC architecture, and it provides an alternative to some existing technologies such as JSP. Velocity can be used to generate XML files, SQL, PostScript and most other text-based formats.


1 Answers

I think you need to provide $date variable like here

like image 142
Mikita Belahlazau Avatar answered Sep 30 '22 19:09

Mikita Belahlazau