How to get cq:lastModified in jcr:content from HTL?

Avatar

Avatar

bhoang

Avatar

bhoang

bhoang

11-04-2018

Hello,

I want to get cq:lastModified from a jcr:content. I tried there code but it doesn't work.

<div class="last-modify">

     <p>ABC ${properties.cq:lastModified}</p>

     <p>XYZ ${currentPage.properties.cq:lastModified}</p>

     <p>cdg ${currentPage.properties.jcr:lastModified}</p>

</div>

How to do that in singhtly?

Thank you so much,

BienHV

View Entire Topic

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

861

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

861
Arun_Patidar
MVP

25-04-2019

Hi,

You can directly use date in the page using below

${'MM/dd/yyyy HH:mma' @ format=currentPage.lastModified}

Or You can use Java. Please check below :

HTL Date Formatting