Description
The functx:first-day-of-month function returns the date representing the first day of the month of $date as an xs:date value.
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 TypeName | Type | Description |
$date |
xs:anyAtomicType? |
the date |
return value |
xs:date? |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:first-day-of-month" as="xs:date?"
xmlns:functx="http://www.functx.com">
<xsl:param name="date" as="xs:anyAtomicType?"/>
<xsl:sequence select="
functx:date(year-from-date(xs:date($date)),
month-from-date(xs:date($date)),
1)
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:first-day-of-month(
xs:date('2004-01-23')) |
2004-01-01 |
functx:first-day-of-month(
xs:dateTime('2004-01-23T12:00:13')) |
2004-01-01 |
functx:first-day-of-month('2004-03-23') |
2004-03-01 |
Depends OnSee AlsoHistory |
Recommended Reading:
|