Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

$content.lastModificationDate.getTime() does not returning timestamp

I am trying to write a user macro which will return difference days between current date and last modified date. 

But, $content.lastModificationDate.getTime() does not returning anything. 

Can someone please help? 

1 answer

Yeah, some of the methods are a bit funky. Here is code I have used to get the year for a copyright

#set ($year = $lastModificationDate.getYear()+1900)

But I think what you need to do is use the date formatter. For example,

$action.dateFormatter.formatDateTime($page.getLastModificationDate())

And then work your magic from there.

 

And here is another example that might help you:

#set ( $dateInfo=$action.dateFormatter.formatGivenString("yyyy-MM-dd HH:mm:ss Z", $content.lastModificationDate) )

Hi @bill_bailey 

Thanks so much for the response. I think, I need to timestamp. 

`

$action.dateFormatter.formatDateTime($page.getLastModificationDate()) 

 

This returns date Dec 13, 2021 16:25 Mon . 

 

If I get the timeStamp, then I can find the difference between last modified and created. 

 

Do you know how to get it?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

1,095 views 8 44
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you