home contribute faq download

FunctX XQuery Functions

functx:month-name-en

The month of a date as a word (January, February, etc.)

Google
Webxqueryfunctions.com

Description

The functx:month-name-en function returns the month of $date as an xs:string in English, as in "January", "February", 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

NameTypeDescription
$date xs:anyAtomicType? the date
return value xs:string?

XQuery Function Declaration

See XSLT definition.
declare namespace functx = "http://www.functx.com";
declare function functx:month-name-en
  ( $date as xs:anyAtomicType? )  as xs:string? {

   ('January', 'February', 'March', 'April', 'May', 'June',
    'July', 'August', 'September', 'October', 'November', 'December')
   [month-from-date(xs:date($date))]
 } ;

Examples

XQuery ExampleResults
functx:month-name-en(xs:date('2004-01-23'))
January
functx:month-name-en(
     xs:dateTime('2004-01-23T12:00:13'))
January
functx:month-name-en('2004-01-23')
January

See Also

functx:month-abbrev-enThe month of a date as an abbreviated word (Jan, Feb, etc.)
fn:month-from-dateThe month portion of a date
fn:month-from-dateTimeThe month portion of a date/time

History

Published OnLast UpdatedContributor(s)
2006-06-272007-02-26Priscilla Walmsley, Datypic, pwalmsley@datypic.com, http://www.datypic.com
Datypic XQuery Services

Recommended Reading:

XQuery