Description
The functx:day-in-year function returns the day of the year of $date as a number, where 1 is January 1, etc.
The $date argument must be castable to xs:date, meaning that it must have the type xs:date or xs:dateTime, or be an xs:string or untyped value of the form YYYY-MM-DD.
Arguments and Return Type| Name | Type | Description |
$date |
xs:anyAtomicType? |
the date |
| return value |
xs:integer? |
XSLT Function Declaration| See XQuery definition. | | XSLT 2.0 Syntax: |
|---|
<xsl:function name="functx:day-in-year" as="xs:integer?"
xmlns:functx="http://www.functx.com" >
<xsl:param name="date" as="xs:anyAtomicType?"/>
<xsl:sequence select="
days-from-duration(
xs:date($date) - functx:first-day-of-year($date)) + 1
"/>
</xsl:function>
|
Examples| XSLT Example | Results |
|---|
functx:day-in-year(xs:date('2004-01-01'))
|
1
|
functx:day-in-year(
xs:dateTime('2004-02-01T12:00:13'))
|
32
|
functx:day-in-year('2004-02-05')
|
36
|
Depends OnHistory |
|