How to calculate the difference between two dates

Hi all, I have a really big favour to ask... Im stuck with math nor do i have a clue on how to correctly express it.

Im also bit of a gumby (new) to Atlassian Wiki markup. Any advice or providing code to achieve what I need is greatly appreciated in advance.

I have a Main Report page (see Main Report Page code below) that has a data entry field for an Incident number and when the 'click to record a easyclaim outage' button is selected, a second page is rendered from a template (see TEMPLATE code below). The second page is a form that includes Start and End Dates/Time fields plus others that are manually entered by the user. Once the record is saved (as a new child page), the first page 'Main Report page' also then displays a filter of all Incident records (new child pages) ever created displaying the record data previously entered by user from created records (child pages).

What I actually require is for the template field 'Outage Duration' to auto calculate the number of days, hours, minutes between the 'Outage Start Date' , 'Outage Start Time' fields and current date/time until the 'Outage End Date/Time fields are popluated.

Main Report Page


h6. Please note: It is \*\*{color:#ff0000}Mandatory{color}\*\* that a system availability record is logged each day before 10am.

h6. KEY: Enter the '{color:#008000}Incident Number{color}' for the Easyclaim Outage or if no outage occured enter the word {color:#000000}'{color}{color:#008000}Available{color}' below.

h6. \*Please enter date(s) applicable on the following page presented.
Click to record a Easyclaim outage
{table-filter:userfilter=Date of Record, Incident No, Outage Start Date, Outage Start Time, Outage End Date, Outage End Time, Outage Duration, Outage Type, Environment, Description, Resolution|button=true}
{table-plus:columnTypes=dd MMM yyyy,S,dd MMM yyyy,HH:mm,dd MMM yyyy,HH:mm,I,S,S,S,S}
{metadata-report:Creator,Page,Date of Record,Incident No,Outage Start Date,Outage Start Time,Outage End Date,Outage End Time,Outage Duration,Outage Type,Environment,Description,Resolution}
{table-filter}{html}<a href="#main">Back to Top</a>


||[Return to Easyclaim Availability and Outage|Easyclaim Availability and Outage]||

||{fontsize:size=1}Date of Record{fontsize}|{fontsize:size=1}Enter date of this record entry (usually todays date).{fontsize}|
||{fontsize:size=1}Incident No{fontsize}|{fontsize:size=1}Auto-populated{fontsize}|
||{fontsize:size=1}Outage Start Date{fontsize}|{fontsize:size=1}Enter date the outage was initially identified.{fontsize}|
||{fontsize:size=1}Outage Start Time{fontsize}|{fontsize:size=1}Enter time the outage was initially identified.{fontsize}|
||{fontsize:size=1}Outage End Date{fontsize}|{fontsize:size=1}Enter date the outage was resolved.{fontsize}|
||{fontsize:size=1}Outage End Time{fontsize}|{fontsize:size=1}Enter time the outage was resolved.{fontsize}|
||{fontsize:size=1}Outage Duration{fontsize}|{fontsize:size=1}Auto-calculated.{fontsize}|
||{fontsize:size=1}Outage Type{fontsize}|{fontsize:size=1}Define the Outage Type.{fontsize}||
||{fontsize:size=1}Environment{fontsize}|{fontsize:size=1}Define the IT environment.{fontsize}||
||{fontsize:size=1}Description{fontsize}|{fontsize:size=1}Describe the symtom and possible cause(s).{fontsize}||
||{fontsize:size=1}Resolution{fontsize}|{fontsize:size=1}Explanation of cause and what was required to resolve issue.{fontsize}||
||[Return to Easyclaim Availability and Outage|Easyclaim Availability and Outage]||
{tip:title=Record Availability and Outage detail here:}

|Date of Record| {date-data:name=list field1|format=dd-MMM-yyyy} {date-data} |
|Incident No| {report-info:page:title} |
|Outage Start Date| {date-data:name=list field1|format=dd-MMM-yyyy} {date-data} |
|Outage Start Time| {date-data:name=list field2|format=HH:mm}{date-data} |
|Outage End Date| {date-data:name=list field3|format=dd-MMM-yyyy} {date-data} |
|Outage End Time| {date-data:name=list field4|format=HH:mm}{date-data}|
|Outage Duration| {eval-data:outage duration|format=#000}${Outage End Date}-${Outage Start Date}{eval-data}|

||Outage Type| {list-data:name=outage type|type=select|multiple=false}
{list-data} ||
||Environment| {list-data:name=environment|type=select|multiple=false}
{list-option}Production{list-option} {list-option}Vendor{list-option}
{list-data} ||
||Description|{text-data:name=description|type=area|width=600px} {text-data}||
||Resolution|{text-data:name=resolution|type=area|width=600px} {text-data}||
\|\|Reserved for Future Use\|.......................................................................................\|

1 answer


For any calculations in Confluence, including calculations over tables, you may use CelesteCS Math for Confluence. There are versions for both Confluence Server and Confluence Cloud.

Assume you have a table with three rows and four columns: A till D with two rows and want to summarize elements from B2 to D2. Then here is the formula you should specify in A2:


If you want to calculate average value, use AVG function:


As you see, it is very simple and is similar to EXCEL with equal set of functions.

There is a plenty of other functions in the macro, so you may perform any calculations using formulas in EXCEL style.


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

1,496 views 4 13
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you