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"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With