Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

hours-from-duration

hours-from-duration

Returns the hours in a duration.

Syntax

fn:hours-from-duration(arg)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
arg
Required
The duration value from which the hours component is to be extracted.
The duration-value is an empty sequence or is a value that has one of the following types:
  • xs:dayTimeDuration
  • xs:duration
  • xs:yearMonthDuration

Return Value

  • If duration-value is of type xs:dayTimeDuration or is of type xs:duration, the returned value is of type xs:integer, and is a value between -23 and 23, inclusive. The value is the hours component of duration-value cast as xs:dayTimeDuration.
  • If duration-value is of type xs:yearMonthDuration, the returned value is of type xs:integer and is 0.
  • If duration-value is an empty sequence, the returned value is an empty sequence.
  • If duration-value is negative, the returned value is negative.

Example

The following expression returns the hours from the duration:
fn:hours-from-duration(xs:dayTimeDuration('DURATION'))
The following table lists some sample values and return values:
DURATION
RETURN VALUE
P1DT5H
5
-PT36H
-12
PT23H
23
PT1H90M
2
PT2H59M
2
PT3600S
1

0 COMMENTS

We’d like to hear from you!