XQuery conversion for date to dateTime
I have a variable parameter that is formatted to the date type in XML. I开发者_运维百科 need to convert that parameter into the dateTime format for another variable to accept my copy operation. This is being done in BPEL, but the expression builder for XQuery should be the same regardless of the processing language. Thanks very much for any help.
When $date holds the xs:date value, then
$date cast as xs:dateTime
will do the job. See the section on casting in the XQuery recommendation for details
Alternatively, you could pass the xs:date value into the xs:dateTime constructor function:
xs:dateTime($date)
Also there is a special constructor function fn:dateTime that gives control of the time part:
fn:dateTime($date, xs:time("17:30:00"))
精彩评论