Date and time macro

Uththira pandi July 6, 2014

How to include current date and time by macro in the conflunce page? Any possiblities..?

2 answers

1 accepted

0 votes
Answer accepted
rahuldanwade
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2014

use the dateFormatter's formatGivenString() method to specify a format:

$action.dateFormatter.formatGivenString("dd-MMM-yyyy", $some_date)

You can use other methods .

follow API docs on it:

https://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/core/DateFormatter.html

1 vote
Siddheshwar mhetre
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 6, 2014

Hello Uththira,

Create new user macro form Confluence admin -> User macros -> create new macro and put the below on bottom of the Template.

$action.dateFormatter.formatGivenString("dd-MMM-yyyy hh:mm:ss", $content.currentDate)

Give the macro name. example- current-date-time. Save the macro

Inser macro in page {current-date-time}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events