This function subtracts two timestamps using a JWT calendar. The time time difference will be returned in milliseconds.

Syntax
timeDifference(firstDate, dateToSubtract, calendarName, timeZone) #Output: Number
Examples


Assumption: A custom JWT calendar called "my_calendar" has been defined as follows:
MON - THU {
   08:00 - 15:00,
   16:00 - 19:30;
}
 
FRI {
    08:00 - 15:00;
}

Parser expressionDescription
timeDifference({system.currentDateTime}, {issue.created}, "my-calendar", LOCAL)

This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar.

The result will return milliseconds.

timeDifference({system.currentDateTime}, {issue.created}, "my-calendar", LOCAL) / {HOUR}

This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar.

The result will return hours.

Additional information

Parameters used in this function

ParameterInput (data type)Description
firstDate

NUMBER

The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).
dateToSubtract

NUMBER

The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).

calendarName

TEXT

The name of the used JWT calendar.
timeZone

TIMEZONE

The time zone used for the conversion. 

Output

The function returns a NUMBER .


Variant of the function where you can define an additional JWT calendar specification.

Syntax
timeDifference(firstDate, dateToSubtract, calendarName, additionalSpecifier, timeZone) #Output: Number
Examples
Parser expressionDescription
timeDifference({system.currentDateTime}, {issue.created}, "my-calendar", "2020/05/20 {;}", LOCAL)

This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar and additionally ignoring the 20th of May, 2020.

The result will return milliseconds.

timeDifference({system.currentDateTime}, {issue.created}, "my-calendar", "2020/05/20 {;}", LOCAL) / {HOUR}

This example calculates the elapsed time from issue creation to the current date and time using the calendar my-calendar and additionally ignoring the 20th of May, 2020.

The result will return hours.

Additional information

Parameters used in this function

ParameterInput (data type)Description
firstDate

NUMBER

The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).
dateToSubtract

NUMBER

The parameter must be valid timestamp. Usually this value is retrieved from a field (e.g. due date, created date).

calendarName

TEXT

The name of the used JWT calendar.
additionalSpecifier

TEXT

A text containing an additional JWT calendar specification
timeZone

TIMEZONE

The time zone used for the calculation. 

Output

The function returns a NUMBER


Use cases and examples