Description
The functx:time function constructs an xs:time value from arguments representing the hour, minute and second. The arguments can have any type that can be cast to xs:integer . If the combination does not result in a valid time (e.g. the hour is 25 or the minute is 61), an error is raised. The function does not currently support decimal numbers for $second .
Arguments and Return TypeName | Type | Description |
$hour |
xs:anyAtomicType |
the hour |
$minute |
xs:anyAtomicType |
the minute |
$second |
xs:anyAtomicType |
the second |
return value |
xs:time |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:time" as="xs:time"
xmlns:functx="http://www.functx.com">
<xsl:param name="hour" as="xs:anyAtomicType"/>
<xsl:param name="minute" as="xs:anyAtomicType"/>
<xsl:param name="second" as="xs:anyAtomicType"/>
<xsl:sequence select="
xs:time(
concat(
functx:pad-integer-to-length(xs:integer($hour),2),':',
functx:pad-integer-to-length(xs:integer($minute),2),':',
functx:pad-integer-to-length(xs:integer($second),2)))
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:time(20,6,12) |
20:06:12 |
functx:time('20','6','12') |
20:06:12 |
Depends OnSee AlsoHistory |
Recommended Reading:
|