blob: 611b868015618fb81c22cf31c3fc385ccd02eeff [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Arithmetic Functions on Durations</title><link href="book.css" rel="stylesheet" type="text/css"><link href="../book.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.74.0" name="generator"><link rel="home" href="index.html" title="XPath 2.0 Processor User Manual"><link rel="up" href="ch04.html" title="How to use XPath 2.0 operators with PsychoPath"><link rel="prev" href="ch04s04.html" title="Comparisons of Duration, Date and Time Values"><link rel="next" href="ch04s06.html" title="Arithmetic Functions Dates and Times"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="Arithmetic_Functions_on_Durations"></a>Arithmetic Functions on Durations</h2></div></div></div><p><pre class="programlisting">multiply-dayTimeDuration(xs:dayTimeDuration("PT2H10M"), 2.1)</pre></p><p>from within a Java application, in order to extract the result
from the result sequence, one would have to use this code:</p><p><pre class="programlisting">String n = ((XDTDayTimeDuration)rs.first()).stringvalue();
println(n);</pre></p><p>which returns a xdt:dayTimeDuration value corresponding to 4 hours
and 33 minutes &lsquo;PT4H33M&rsquo;</p></div></body></html>