views:

32

answers:

1

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
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
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