EXSLT - date:parse-date - Version 1

Version: 1
Status: new
User Page: index.html
XML Definition: date.parse-date.xml
Function Package: date.parse-date.zip

Function Syntax

string date:parse-date(string, string, string?)

The date:parse-date function parses a string into a date/time string according to a pattern.

The first argument to date:parse-date is a string that gives a date/time in a particular format.

The second argument is a string that gives the format pattern that has been used to format the date/time given as the first argument. The format pattern is interpreted according to the date format (declared by date:date-format) named by the third argument, or the default date format if there is no third argument. For details about how the format pattern is constructed and used, see date:date-format).

The result of applying the format pattern string to the date/time passed as the first argument is an interpreted date. This interpreted date is formatted as a right or left-truncated date/time strings in one of the formats defined in [XML Schema Part 2: Datatypes]. The permitted formats are as follows:

The interpreted date is formatted to the least specific format of the above as possible, providing that all the components specified for it is are represented within the result. If the interpreted date includes a year, then the format must be one of xs:dateTime, xs:date, xs:gYearMonth or xs:gYear; if it specifies an hour, then it must be one of xs:dateTime or xs:time and so on. If the format includes a component that is not specified within the interpreted date, then these components are given default values as follows: year defaults to 0001, month and day default to 01, hour, minute and second default to 00.

An implementation of this extension function in the EXSLT date namespace must conform to the behaviour described in this document.

Implementations

No XSLT processors that we know of have built-in support for date:parse-date.

There are currently no third-party implementations of date:parse-date.

Change History

Submitted: 2001-05-12
Creator: Jeni Tennison (http://www.jenitennison.com/)

Formats a date/time string according to a format string, using a particular date format.

http://www.exslt.org/date/functions/parse-date/date.parse-date.1.html last modified 2001-05-12