functx:is-leap-year

Whether a date falls in a leap year

Description

The functx:is-leap-year function returns true if $date falls in a leap year.

The first four characters of the string value of $date must be the year. For example, the argument can be a value of type xs:date, xs:dateTime, or an xs:integer with four significant digits, or an xs:string or untyped value of the form YYYY or YYYY-MM-DD.

Parameters

Description

date:date()

the date or year

Examples

XPath

Results

functx:is-leap-year(xs:date(‘2004-01-23’))

true

functx:is-leap-year(2004)

true

functx:is-leap-year(‘2005-02-15’)

false

See Also