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

Compare with Current View Page History

« Previous Version 13 Next »

The function returns a text representing a time duration, i.e. a subtraction of two date-time values, using the current user's language.

Syntax
formatDuration(duration) #Output: Text
Examples
Parser expressionDescription
formatDuration(2020-01-31 11:30 - 2020-01-30 00:00)

This example returns: "1 day, 11 hours, 30 minutes".

In this case the language is set to English.

formatDuration({issue.resolutionDate} - {issue.created})

This example returns the time between the creation and resolution of an issue.


Additional information

Parameters used in this function

ParameterInput (data type)Description
duration

NUMBER

A number representing a duration or the calculation of a duration.
Output

The function returns a TEXT

This function is extremely helpful when you want to automatically calculate the duration in JWT calculated text fields.

If you prefer a more comprehensive representation, have a look at the shortFormatDuration() function.

formatDuration()shortFormatDuration()
"1 day, 11 hours, 30 minutes"."1d 11h 30m"