Pergunta
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.
Solução
$dateString = $date.format('yyyy',$UtilMethods.getCurrentDate())
Not sure entirely, looks right, maybe try lower case 'yyyy' is the only difference I found in research.
Outras dicas
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
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow