blob: 41722ead599e586b88f631fc8b6cbe6b6696e457 [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Arithmetic Functions Dates and Times</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="ch04s05.html" title="Arithmetic Functions on Durations"><link rel="next" href="ch04s07.html" title="Operators Related to QNames And Nodes"></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_Dates_and_Times"></a>Arithmetic Functions Dates and Times</h2></div></div></div><p><pre class="programlisting">add-yearMonthDuration-to-dateTime( xs:dateTime("2000-10-30T11:12:00"), xdt:yearMonthDuration("P1Y2M"))</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 = ((XSDateTime)rs.first()).stringvalue();
println(n);</pre></p><p>which returns an xs:dateTime value corresponding to the lexical
representation &lsquo;2001-12-30T11:12:00&rsquo;</p></div></body></html>