Hello, 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.
+3
A:
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"))
Gunther
2010-08-22 10:46:58
Thanks but I found the solution on my school message board. All I needed to do was concat ($datevariable, 'T20:30:00')I still appreciate the help and up-voted the answer for others.
fwc
2010-08-28 12:07:11
OK if you know what you are doing, but it is a string operation and as such more vulnerable (e.g. by misspelling) than the corresponding typed operation that I suggested.
Gunther
2010-08-30 15:10:14