jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: How to write this query which can contraint the datetime type property in appointed parameter
Date Mon, 20 Nov 2006 10:09:57 GMT
wendy Lee wrote:
> Is this right?
> "//wd:resources//element(*,wd:mlv)[@wd:created > "+ lastWeek+ "]"
> 
> here "lastWeek" is Java Date Type.

No, that won't work. you have to use the constructor function fn:dateTime() with 
a string parameter that conforms to ISO8601. See also jsr 170 spec section 6.2.5.1:

"The text format of dates must follow the following ISO 8601:2000-
compliant format:
sYYYY - MM - DD T hh : mm : ss . sssTZD
where:
sYYYY Four-digit year with optional leading positive (‘ + ’) or
negative (‘ - ’) sign. A negative sign indicates a year BCE. The
absence of a sign or the presence of a positive sign indicates a year
CE (for example, -0055 would indicate the year 55 BCE, while
+1969 and 1969 indicate the year 1969 CE).
MM Two-digit month (01 = January, etc.)
DD Two-digit day of month (01 through 31)
hh Two digits of hour (00 through 23)
mm Two digits of minute (00 through 59)
ss.sss Seconds, to three decimal places (00.000
through 59.999)
TZD Time zone designator (either Z for Zulu, i.e. UTC, or
+hh:mm or -hh:mm, i.e. an offset from UTC)

Note that the "T" separating the date from the time and the
separators "-" and ":" appear literally in the string. See
http://www.w3.org/TR/NOTE-datetime for more information."

regards
  marcel

Mime
View raw message