Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,554,402
Community Members
 
Community Events
184
Community Groups

$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?

Bong Chit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 12, 2023

@bill_bailey

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events