Version: 1 Status: implemented User Page: index.html XML Definition: date.duration.xml Function Package: date.duration.zip Function Syntaxstring date:duration(number?) Template Syntax<xsl:call-template name="date:duration">
<xsl:with-param name="seconds" select="number" />?
</xsl:call-template>
The date:duration function returns a duration string representing the number of seconds specified by the argument string. If no argument is given, then the result of calling date:seconds without any arguments is used as a default argument.
The duration is returned as a string in the format defined for xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
The number of years and months in the duration string must be equal to zero. (The format of the string will be PnDTnHnMnS .) 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.
If the argument is Infinity , -Infinity or NaN , then date:duration returns an empty string ('' ).
An implementation of this extension
function
in the EXSLT date namespace must conform to the behaviour described in this document.
Implementations
Built-in support for date:duration is available in the following XSLT processors:
The following implementations of date:duration are available:
Change HistorySubmitted: 2001-05-12 Creator: Jeni Tennison(http://www.jenitennison.com/)
Returns the result of converting the argument number of seconds to a duration string, or the current date/time as a duration since 1970-01-01T00:00:00Z.
Version | Modified | By | Details |
---|
1.1 | 2001-06-11 | Jeni Tennison |
Added Javascript implementation.
| 1.2 | 2001-06-12 | Jeni Tennison |
Added implementations in XSLT and EXSLT - Functions.
| 1.3 | 2001-06-16 | Jeni Tennison | - Updated Javascript implementation.
- Added Microsoft-specific stylesheet.
| 1.4 | 2002-08-21 | Craig Stewart | Added libxslt implementation to the list. |
|