Description
The functx:month-abbrev-en function returns the month of $date as an abbreviated xs:string in English, as in "Jan", "Feb", 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:string? |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:month-abbrev-en
( $date as xs:anyAtomicType? ) as xs:string? {
('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
[month-from-date(xs:date($date))]
} ; | | XQuery Syntax for July 2004 - November 2005 (CR): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:month-abbrev-en
( $date as xdt:anyAtomicType? ) as xs:string? {
('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
[month-from-date(xs:date($date))]
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function month-abbrev-en
( $date as xdt:anyAtomicType? ) as xs:string? {
('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec')
[fn:get-month-from-date(xs:date($date))]
} |
Examples| XQuery Example | Results |
|---|
functx:month-abbrev-en(xs:date('2004-01-23'))
|
Jan
|
functx:month-abbrev-en(
xs:dateTime('2004-01-23T12:00:13'))
|
Jan
|
functx:month-abbrev-en('2004-01-23')
|
Jan
|
See AlsoHistory |
|