root / projects / DailyDrillingReport_1.2 / Deliveries / PDFreport / difference / date.difference.html @ 336

Revision 336, 11.9 kB (checked in by karianne, 8 years ago)
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE html
3  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "/schema/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"><head><title>EXSLT - date:difference - Implementer Page</title><link rel="stylesheet" href="base.css"/></head><body><h1 id="#title"><a href="http://www.exslt.org/">EXSLT</a> - <a href="http://www.exslt.org/date">date</a>:<a href="http://www.exslt.org/date/functions/difference">difference</a> - Implementer Page</h1><table><tr><td id="menu"><p class="level1"><a href="index.html">User Page</a></p><p class="level1"><a href="../../../howto.html">How To</a></p><p class="level1"><a href="../../../download.html">Downloads</a></p><p class="level1">Modules</p><p class="level2"><a href="../../../date/date.html">Dates and Times</a></p><p class="level3"><a href="../../functions/add/date.add.html">date:add()</a></p><p class="level3"><a href="../../functions/add-duration/date.add-duration.html">date:add-duration()</a></p><p class="level3"><a href="../../functions/date/date.date.html">date:date()</a></p><p class="level3"><a href="../../functions/date-time/date.date-time.html">date:date-time()</a></p><p class="level3"><a href="../../functions/day-abbreviation/date.day-abbreviation.html">date:day-abbreviation()</a></p><p class="level3"><a href="../../functions/day-in-month/date.day-in-month.html">date:day-in-month()</a></p><p class="level3"><a href="../../functions/day-in-week/date.day-in-week.html">date:day-in-week()</a></p><p class="level3"><a href="../../functions/day-in-year/date.day-in-year.html">date:day-in-year()</a></p><p class="level3"><a href="../../functions/day-name/date.day-name.html">date:day-name()</a></p><p class="level3"><a href="../../functions/day-of-week-in-month/date.day-of-week-in-month.html">date:day-of-week-in-month()</a></p><p class="level3"><a href="../../functions/difference/date.difference.html">date:difference()</a></p><p class="level3"><a href="../../functions/duration/date.duration.html">date:duration()</a></p><p class="level3"><a href="../../functions/format-date/date.format-date.html">date:format-date()</a></p><p class="level3"><a href="../../functions/hour-in-day/date.hour-in-day.html">date:hour-in-day()</a></p><p class="level3"><a href="../../functions/leap-year/date.leap-year.html">date:leap-year()</a></p><p class="level3"><a href="../../functions/minute-in-hour/date.minute-in-hour.html">date:minute-in-hour()</a></p><p class="level3"><a href="../../functions/month-abbreviation/date.month-abbreviation.html">date:month-abbreviation()</a></p><p class="level3"><a href="../../functions/month-in-year/date.month-in-year.html">date:month-in-year()</a></p><p class="level3"><a href="../../functions/month-name/date.month-name.html">date:month-name()</a></p><p class="level3"><a href="../../functions/parse-date/date.parse-date.html">date:parse-date()</a></p><p class="level3"><a href="../../functions/second-in-minute/date.second-in-minute.html">date:second-in-minute()</a></p><p class="level3"><a href="../../functions/seconds/date.seconds.html">date:seconds()</a></p><p class="level3"><a href="../../functions/sum/date.sum.html">date:sum()</a></p><p class="level3"><a href="../../functions/time/date.time.html">date:time()</a></p><p class="level3"><a href="../../functions/week-in-month/date.week-in-month.html">date:week-in-month()</a></p><p class="level3"><a href="../../functions/week-in-year/date.week-in-year.html">date:week-in-year()</a></p><p class="level3"><a href="../../functions/year/date.year.html">date:year()</a></p><p class="level3"><a href="../../elements/date-format/date.date-format.html">date:date-format</a></p><p class="level2"><a href="../../../dyn/dyn.html">Dynamic</a></p><p class="level2"><a href="../../../exsl/exsl.html">Common</a></p><p class="level2"><a href="../../../func/func.html">Functions</a></p><p class="level2"><a href="../../../math/math.html">Math</a></p><p class="level2"><a href="../../../random/random.html">Random</a></p><p class="level2"><a href="../../../regexp/regexp.html">Regular Expressions</a></p><p class="level2"><a href="../../../set/set.html">Sets</a></p><p class="level2"><a href="../../../str/str.html">Strings</a></p><p class="level1"><a href="../../../submissions/">Submissions</a></p><p class="level1"><a href="../../../list">Mailing List</a></p><p class="level1"><a href="../../../contact.html">Contact</a></p></td><td id="content"><p><b>Version: </b>1<br/><b>Status: </b>implemented<br/><b>User Page: </b><a href="index.html">index.html</a><br/><b>XML Definition: </b><a href="date.difference.xml">date.difference.xml</a><br/><b>Function Package: </b><a href="date.difference.zip">date.difference.zip</a></p><h4>Function Syntax</h4><pre><var>string</var> <b>date:difference</b>(<var>string</var>, <var>string</var>)</pre><h4>Template Syntax</h4><pre>&lt;xsl:call-template name="<b>date:difference</b>"&gt;
5   &lt;xsl:with-param name="start" select="<var>string</var>" /&gt;
6   &lt;xsl:with-param name="end" select="<var>string</var>" /&gt;
7&lt;/xsl:call-template&gt;</pre><div><p>
8         The <code>date:difference</code> function returns the duration between the first date and the second date.  If the first date occurs before the second date, then the result is a positive duration; if it occurs after the second date, the result is a negative duration.
9      </p><p>
10         The two dates must both be right-truncated date/time strings in one of the formats defined in [<a href="http://www.w3.org/TR/xmlschema-2/" class="offsite">XML Schema Part 2: Datatypes</a>].  The date/time with the most specific format (i.e. the least truncation) is converted into the same format as the date with the most specific format (i.e. the most truncation).  The permitted formats are as follows, from most specific to least specific:
11      </p><ul><li><a href="http://www.w3.org/TR/xmlschema-2/#dateTime" class="offsite"><code>xs:dateTime</code></a> (<code><var>CCYY</var>-<var>MM</var>-<var>DD</var>T<var>hh</var>:<var>mm</var>:<var>ss</var></code>)
12         </li><li><a href="http://www.w3.org/TR/xmlschema-2/#date" class="offsite"><code>xs:date</code></a> (<code><var>CCYY</var>-<var>MM</var>-<var>DD</var></code>)
13         </li><li><a href="http://www.w3.org/TR/xmlschema-2/#gYearMonth" class="offsite"><code>xs:gYearMonth</code></a> (<code><var>CCYY</var>-<var>MM</var></code>)
14         </li><li><a href="http://www.w3.org/TR/xmlschema-2/#gYear" class="offsite"><code>xs:gYear</code></a> (<code><var>CCYY</var></code>)
15         </li></ul><p>
16         If either of the arguments is not in one of these formats, <code>date:difference</code> returns the empty string (<code>''</code>).
17      </p><p>
18         The difference between the date/times is returned as a string in the format defined for <code>xs:duration</code> in [<a href="http://www.w3.org/TR/xmlschema-2/#duration" class="offsite">3.2.6 duration</a>] of [<a href="http://www.w3.org/TR/xmlschema-2/" class="offsite">XML Schema Part 2: Datatypes</a>].
19      </p><p>
20         If the date/time string with the least specific format is in either <code>xs:gYearMonth</code> or <code>xs:gYear</code> format, then the number of days, hours, minutes and seconds in the duration string must be equal to zero.  (The format of the string will be <code>P<var>n</var>Y<var>n</var>M</code>.)  The number of months specified in the duration must be less than 12.
21      </p><p>
22         Otherwise, the number of years and months in the duration string must be equal to zero.  (The format of the string will be <code>P<var>n</var>DT<var>n</var>H<var>n</var>M<var>n</var>S</code>.)  The number of seconds specified in the duration string must be less than 60; the number of minutes must be less than 60; the number of hours must be less than 24.
23      </p></div><p>
24      An implementation of this extension
25      function
26      in the EXSLT date namespace must conform to the behaviour described in this document.
27   </p><h2>Implementations</h2><p>
28            Built-in support for <code>date:difference</code> is available in the following XSLT processors:
29         </p><table><tr><th class="rowhead">Processor</th><th>Processor Version</th><th>Implemented Version</th></tr><tr><td class="rowhead"><a href="http://4Suite.org">4XSLT, from 4Suite.</a></td><td>0.12.0a3</td><td>1</td></tr><tr><td class="rowhead"><a href="http://xmlsoft.org/XSLT/">libxslt from Daniel Veillard et al.</a></td><td>1.0.19</td><td>1</td></tr></table><p>
30            The following implementations of <code>date:difference</code> are available:
31         </p><table><tr><th class="rowhead">Language</th><th>Implemented Version</th><th>Creator</th><th>Date</th><th>Download</th></tr><tr><td class="rowhead"><a href="date.difference.function.xsl.html">EXSLT Function</a></td><td>1</td><td><a href="mailto:[email protected]">Jeni Tennison</a></td><td>2001-05-12</td><td><a href="date.difference.function.xsl">date.difference.function.xsl</a></td></tr><tr><td class="rowhead"><a href="date.difference.template.xsl.html">XSLT Template</a></td><td>1</td><td><a href="mailto:[email protected]">Jeni Tennison</a></td><td>2001-05-12</td><td><a href="date.difference.template.xsl">date.difference.template.xsl</a></td></tr><tr><td class="rowhead"><a href="date.js.html">Javascript</a></td><td>1</td><td><a href="mailto:[email protected]">Chris Bayes</a></td><td>2001-06-11</td><td><a href="date.js">date.js</a></td></tr><tr><td class="rowhead"><a href="date.msxsl.xsl.html">Msxsl</a></td><td>1</td><td><a href="mailto:[email protected]">Chris Bayes</a></td><td>2001-06-16</td><td><a href="date.msxsl.xsl">date.msxsl.xsl</a></td></tr></table><h2>Change History</h2><p><b>Submitted: </b>2001-05-12<br/><b>Creator: </b><a href="mailto:[email protected]">Jeni Tennison</a>(<a href="http://www.jenitennison.com/">http://www.jenitennison.com/</a>)</p><p><dc:description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exslt="http://exslt.org/documentation">
32            Returns the difference between two dates as a duration.
33         </dc:description></p><table><tr><th class="rowhead">Version</th><th>Modified</th><th>By</th><th>Details</th></tr><tr><td class="rowhead">1.1</td><td style="width: 5em;">2001-06-11</td><td><a href="mailto:[email protected]">Jeni Tennison</a></td><td style="text-align: left;"><p><dc:description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exslt="http://exslt.org/documentation">
34            Added implementations in Javascript, XSLT and EXSLT - Functions.
35         </dc:description></p></td></tr><tr><td class="rowhead">1.2</td><td style="width: 5em;">2001-06-16</td><td><a href="mailto:[email protected]">Jeni Tennison</a></td><td style="text-align: left;"><dc:description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exslt="http://exslt.org/documentation"><ul><li>Updated Javascript implementation.</li><li>Added Microsoft-specific stylesheet.</li></ul></dc:description></td></tr><tr><td class="rowhead">1.3</td><td style="width: 5em;">2002-08-21</td><td><a href="mailto:[email protected]">Craig Stewart</a></td><td style="text-align: left;"><p><dc:description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exslt="http://exslt.org/documentation">Added 4XSLT and libxslt implementation to the list.</dc:description></p></td></tr><tr><td class="rowhead">1.4</td><td style="width: 5em;">2002-11-12</td><td><a href="mailto:[email protected]">Craig Stewart</a></td><td style="text-align: left;"><p><dc:description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:exslt="http://exslt.org/documentation">Updated 4XSLT version to 0.12.0a3.</dc:description></p></td></tr></table></td></tr></table><div id="colophon"><p><a href="http://www.exslt.org/date/functions/difference/date.difference.html">http://www.exslt.org/date/functions/difference/date.difference.html</a> last modified 2002-11-12</p></div></body></html>
Note: See TracBrowser for help on using the browser.