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

Revision 336, 8.4 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</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></h1><table><tr><td id="menu"><p class="level1"><a href="date.difference.html">Implementer 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/index.html">Dates and Times</a></p><p class="level3"><a href="../../functions/add/index.html">date:add()</a></p><p class="level3"><a href="../../functions/add-duration/index.html">date:add-duration()</a></p><p class="level3"><a href="../../functions/date/index.html">date:date()</a></p><p class="level3"><a href="../../functions/date-time/index.html">date:date-time()</a></p><p class="level3"><a href="../../functions/day-abbreviation/index.html">date:day-abbreviation()</a></p><p class="level3"><a href="../../functions/day-in-month/index.html">date:day-in-month()</a></p><p class="level3"><a href="../../functions/day-in-week/index.html">date:day-in-week()</a></p><p class="level3"><a href="../../functions/day-in-year/index.html">date:day-in-year()</a></p><p class="level3"><a href="../../functions/day-name/index.html">date:day-name()</a></p><p class="level3"><a href="../../functions/day-of-week-in-month/index.html">date:day-of-week-in-month()</a></p><p class="level3"><a href="../../functions/difference/index.html">date:difference()</a></p><p class="level3"><a href="../../functions/duration/index.html">date:duration()</a></p><p class="level3"><a href="../../functions/format-date/index.html">date:format-date()</a></p><p class="level3"><a href="../../functions/hour-in-day/index.html">date:hour-in-day()</a></p><p class="level3"><a href="../../functions/leap-year/index.html">date:leap-year()</a></p><p class="level3"><a href="../../functions/minute-in-hour/index.html">date:minute-in-hour()</a></p><p class="level3"><a href="../../functions/month-abbreviation/index.html">date:month-abbreviation()</a></p><p class="level3"><a href="../../functions/month-in-year/index.html">date:month-in-year()</a></p><p class="level3"><a href="../../functions/month-name/index.html">date:month-name()</a></p><p class="level3"><a href="../../functions/parse-date/index.html">date:parse-date()</a></p><p class="level3"><a href="../../functions/second-in-minute/index.html">date:second-in-minute()</a></p><p class="level3"><a href="../../functions/seconds/index.html">date:seconds()</a></p><p class="level3"><a href="../../functions/sum/index.html">date:sum()</a></p><p class="level3"><a href="../../functions/time/index.html">date:time()</a></p><p class="level3"><a href="../../functions/week-in-month/index.html">date:week-in-month()</a></p><p class="level3"><a href="../../functions/week-in-year/index.html">date:week-in-year()</a></p><p class="level3"><a href="../../functions/year/index.html">date:year()</a></p><p class="level3"><a href="../../elements/date-format/index.html">date:date-format</a></p><p class="level2"><a href="../../../dyn/index.html">Dynamic</a></p><p class="level2"><a href="../../../exsl/index.html">Common</a></p><p class="level2"><a href="../../../func/index.html">Functions</a></p><p class="level2"><a href="../../../math/index.html">Math</a></p><p class="level2"><a href="../../../random/index.html">Random</a></p><p class="level2"><a href="../../../regexp/index.html">Regular Expressions</a></p><p class="level2"><a href="../../../set/index.html">Sets</a></p><p class="level2"><a href="../../../str/index.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>Implementer Page: </b><a href="date.difference.html">date.difference.html</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><h2>Implementations</h2><p>
24                  The following XSLT processors support <code>date:difference</code>:
25               </p><ul><li><a href="http://4Suite.org">4XSLT, from 4Suite.</a> (version 0.12.0a3)</li><li><a href="http://xmlsoft.org/XSLT/">libxslt from Daniel Veillard et al.</a> (version 1.0.19)</li></ul><p>
26                  Implementations of <code>date:difference</code> are available in the following languages:
27               </p><ul><li><a href="date.difference.function.xsl">EXSLT Function</a> (by <a href="mailto:[email protected]">Jeni Tennison</a>)</li><li><a href="date.difference.template.xsl">XSLT Template</a> (by <a href="mailto:[email protected]">Jeni Tennison</a>)</li><li><a href="date.js">Javascript</a> (by <a href="mailto:[email protected]">Chris Bayes</a>)</li><li><a href="date.msxsl.xsl">Msxsl</a> (by <a href="mailto:[email protected]">Chris Bayes</a>)</li></ul></td></tr></table><div id="colophon"><p><a href="http://www.exslt.org/date/functions/difference/index.html">http://www.exslt.org/date/functions/difference/index.html</a> last modified 2002-11-12</p></div></body></html>
Note: See TracBrowser for help on using the browser.