Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 777
fwc Avatar asked Dec 13 '25 04:12

fwc


1 Answers

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"))
like image 108
Gunther Avatar answered Dec 15 '25 23:12

Gunther



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!