Duration (FPScript)

10.10.2019
Analyzing Data Mathematically > Reference > FPScript Functions > Calendar Time > Duration

Duration (FPScript)

Generates a time span value using the elements provided.

Syntax

Duration(Hours, Minutes, Seconds)
or
Duration(Days, Hours, Minutes, Seconds)

The syntax of the Duration function consists of the following parts:

Part

Description

Days

The number of days in the duration.

Permitted data structures are scalar value. All real data types are permitted. The argument is transformed to the unit d.

Hours

The number of hours in the duration.

Permitted data structures are scalar value. All real data types are permitted. The argument is transformed to the unit h.

Minutes

The number of minutes in the duration.

Permitted data structures are scalar value. All real data types are permitted. The argument is transformed to the unit min.

Seconds

The number of seconds in the duration.

Permitted data structures are scalar value. All real data types are permitted. The argument is transformed to the unit s.

Remarks

The result is a scalar value with the specified time span.

If an argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Note        Constant time span values can also be written directly as FPScript constants.

Available in

FlexPro View, Standard, Professional, Developer Suite

Examples

 Duration(12, 30, 45.6) Results in '12:30:45.6'. Duration(12, -30, 45.6) Results in '11:30:45.6'. -Duration(12, 30, 45.6) Results in -'12:30:45.6'. Duration(-12, -30, -45.6) Results in -'12:30:45.6'. Duration(3, 12, 30, 45.6) Results in '3:12:30:45.6'. Duration(3 d, 12 h, 30 min, 45 ms) Results in '3:12:30:00.045'.