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?
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
$action.dateFormatter.formatDateTime($page.getLastModificationDate())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.