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

How do I add the current date to a template?

Bret Wisecarver January 7, 2021

I am able to add a date from the content by using

 https://confluence.atlassian.com/conf71/configuring-time-and-date-formats-979423992.html 

I am not able to get this date to show the current date, it is showing the date I choose after adding the content. Is it possible to make it default to the current date?

2 answers

1 accepted

0 votes
Answer accepted
Benjamin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2021

Hi @Bret Wisecarver ... There isn't an option on cloud. There might a possibly on server or DC if you manipulate the velocity template. 

3 votes
Fabienne Gerhard
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 7, 2021

Hi @Bret Wisecarver 

welcome to this wonderful community.

As your link is showing server link my solution may work out for you - I created a simple costumer macro which shows last date modified.

##Macro title: AUI Button
## Macro has body: N

## @noparams

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

It's working fine for us.

We use it in a table with page properties and it looks like this.

image.png

Feel free to ask for more help

Pavol Chromik June 5, 2023

Hello @Fabienne Gerhard ,

we had similar user macro on our instance but after migration to Confluence 7.19.8(Data Center) it stop working. We moved from 7.4.18

## Macro title: Current Time
## Macro has a body: N
## Body processing: No macro body
## Developed by: Steven Behnke
## @noparams

##https://community.atlassian.com/t5/Confluence-questions/Insert-current-date-into-Confluence-page/qaq-p/313517
##$action.dateFormatter.formatGivenString("dd-MMM-yyyy hh:mm:ss", $content.currentDate)
$action.dateFormatter.formatGivenString("dd-MMM-yyyy", $content.currentDate)

It is also not working once i tried your version

 

Is there some "how to" to be able to fix it on our current Confluence version?

 

thank you

KR, Pavol

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events