You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

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

Syntax
timeDifference(firstDate, dateToSubtract, calendarName, timeZone) #Output: Number
Examples
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 representing a timestamp.


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

This function is useful when wanting to include personal holidays to an existing calendar.

Syntax
timeDifference(firstDate, dateToSubtract, calendarName, additionalCalendar, 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.
additionalCalendar

TEXT

Additional calendar terms that should be added to the specified calendar for the calculation.
timeZone

TIMEZONE

The time zone used for the conversion. 

Output

The function returns a NUMBER representing a timestamp.