# EXSLT - Dates and Times

Implementer Page: date.html Module Package: date.zip EXSLT - Dates and Times covers date and time-related extension elements and functions. Many of the functions in this module use strings in the formats specified by the date and time-related data types defined in [XML Schema Part 2: Datatypes]. XSLT processors may support any number of the extension elements and functions given in this module. Using EXSLT will only make your stylesheet portable amongst the implementations that support EXSLT. Note that there is no requirement for XSLT processors that are compliant to XSLT to support the extensions described within EXSLT. ## Namespace The namespace for EXSLT - Dates and Times is:
    http://exslt.org/dates-and-times
Throughout this document, the prefix `date` is used to refer to this namespace. Any other prefix can be used within a particular stylesheet (though a prefix must be specified to enable the extension functions to be recognised as extensions). To use these extensions, you need to declare this namespace as an extension namespace in your stylesheet. If your processor supports this module, then that's all you need to do, but if it doesn't, then you need to use a specific third-party implementation or the module stylesheet. Typically, your stylesheet will look like:
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                    xmlns:date="http://exslt.org/dates-and-times"
                    extension-element-prefixes="date">

    <xsl:import href="date.xsl" />

    ...

    </xsl:stylesheet>
## Elements ### Other Elements The following extension elements are not considered stable and are not part of the core of EXSLT - Dates and Times. Processors that claim support of EXSLT - Dates and Times might not support these elements.
Element | Syntax | Download
--- | --- | ---
date:date-format |
    <date:date-format
       name = qname
       calendar = "gregorian" | qname-but-not-ncname
       lang = language
       first-day-of-week = "sunday" | "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | string />
| date.date-format.zip
## Functions ### Core Functions The following extension functions are considered stable and are core to EXSLT - Dates and Times. Processors that claim support of EXSLT - Dates and Times support these functions.
Function | Syntax | Download
--- | --- | ---
date:date-time | string date:date-time() | date.date-time.zip
date:date | string date:date(string?) | date.date.zip
date:time | string date:time(string?) | date.time.zip
date:year | number date:year(string?) | date.year.zip
date:leap-year | boolean date:leap-year(string?) | date.leap-year.zip
date:month-in-year | number date:month-in-year(string?) | date.month-in-year.zip
date:month-name | string date:month-name(string?) | date.month-name.zip
date:month-abbreviation | string date:month-abbreviation(string?) | date.month-abbreviation.zip
date:week-in-year | number date:week-in-year(string?) | date.week-in-year.zip
date:day-in-year | number date:day-in-year(string?) | date.day-in-year.zip
date:day-in-month | number date:day-in-month(string?) | date.day-in-month.zip
date:day-of-week-in-month | number date:day-of-week-in-month(string?) | date.day-of-week-in-month.zip
date:day-in-week | number date:day-in-week(string?) | date.day-in-week.zip
date:day-name | string date:day-name(string?) | date.day-name.zip
date:day-abbreviation | string date:day-abbreviation(string?) | date.day-abbreviation.zip
date:hour-in-day | number date:hour-in-day(string?) | date.hour-in-day.zip
date:minute-in-hour | number date:minute-in-hour(string?) | date.minute-in-hour.zip
date:second-in-minute | number date:second-in-minute(string?) | date.second-in-minute.zip
### Other Functions The following extension functions are not considered stable and are not part of the core of EXSLT - Dates and Times. Processors that claim support of EXSLT - Dates and Times might not support these functions.
Function | Syntax | Download
--- | --- | ---
date:format-date | string date:format-date(string, string) | date.format-date.zip
date:parse-date | string date:parse-date(string, string) | date.parse-date.zip
date:week-in-month | number date:week-in-month(string?) | date.week-in-month.zip
date:difference | string date:difference(string, string) | date.difference.zip
date:add | string date:add(string, string) | date.add.zip
date:add-duration | string date:add-duration(string, string) | date.add-duration.zip
date:sum | string date:sum(node-set) | date.sum.zip
date:seconds | number date:seconds(string?) | date.seconds.zip
date:duration | string date:duration(number?) | date.duration.zip

http://www.exslt.org/date/index.html last modified 2001-05-12