parse-date
Converts a string into a date. This function uses the parse-dateTime function as a basis, while ignoring the time component. The result is of type xs:date.
Languages
Built-in, C++, C#, Java.
Parameters
Argument | Description |
---|---|
value | Mandatory argument. Supplies the string value to be converted. |
format | Mandatory argument. Supplies a format string. This argument is used in the same way as the format argument in the parse-dateTime function. |
Example
The mapping below parses the string "01 Apr 2015", converts it to a date and writes the result to a target item (pubdate) of type xs:date. This was achieved by using the format [D01] [MNn,3-3] [Y], where:
•[D01] is the date of the month, expressed as two digits
•[MNn,3-3] is the month name, with a minim and maximum width of 3 characters
•[Y] is the year
The result is as follows (excluding the XML and namespace declarations):
<book> |