extract time from dateTime

Hello,

i have dateTime element (DRealisation) and i need to do some queries about the time.
More precisely I need to count tne number of documents whose time(DRealisation) is between 20h and 8h.

I have tried to convert it in a String, but after, I need a substring function…
Is there some functions for that. My application is still running and I can’t change my doctypes (can’t store year/hour,… separately).

Thanks for those who will try to help me.

Hi,

You can extract the time from an xs:dateTime instance by applying the substring-after() function. An example is given by the following query:

substring-after(xs:string(xs:dateTime(“1999-05-31T13:20:00”)),“T”)

To apply the substring-after() function, you have to cast the xs:dateTime instance to xs:string via the xs:string() constructor function. Please note that this approach is only possible in Tamino 4.2.

Best regards,

Thorsten Fiebig

Thanks.

But I’m only in version 4.1.4
Is it difficult to upgrade the tamino version ?