Question

How to get current year in dotCMS? I need to display it in footer copyright. I am try this $date.format('YYYY', $UtilMethods.getCurrentDate()) but not working.

Was it helpful?

Solution

$dateString = $date.format('yyyy',$UtilMethods.getCurrentDate())

Not sure entirely, looks right, maybe try lower case 'yyyy' is the only difference I found in research.

OTHER TIPS

This will give the result 2012: $date.format('yyyy',$UtilMethods.getCurrentDate())

Here you can find alot more about dotCMS and Velocity http://dotcms.org/documentation/VelocityAndDotCMS

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top