functx:mmddyyyy-to-date

Converts a string with format MMDDYYYY (with any delimiters) to a date

Description

The functx:mmddyyyy-to-date function converts $dateString into a valid xs:date value. The order of the digits in $dateString must be MMDDYYYY, but it can contain any (or no) delimiters between the digits.

Parameters

Description

dateString:string()

the MMDDYYYY string

Examples

XPath

Results

functx:mmddyyyy-to-date(‘12-15-2004’)

2004-12-15

functx:mmddyyyy-to-date(‘12152004’)

2004-12-15

functx:mmddyyyy-to-date(‘12/15/2004’)

2004-12-15